# Building a Farmers-Market Marketplace That Handles Real Inventory

A farmers-market marketplace looks simple from the outside: shoppers browse local produce, reserve items, and pick them up on market day. The hard part is that inventory is short-lived, vendor-managed, and often updated from a phone while someone is unloading crates at 6 a.m. The platform has to tolerate imperfect data while still preventing overselling.

## Modeling Vendors, Stalls, and Stock

The core model should separate a vendor from a market appearance. A farm may attend three markets in a week, but each stall has its own pickup window, product availability, and quantity limits. Inventory should be scoped to the stall event, not just the vendor or product catalog.

```yaml
market_event:
  id: sat-downtown-2026-07-18
  pickup_window: "08:00-13:00"
  inventory_hold_minutes: 10
  allow_substitutions: true
```

## Checkout Under Uncertain Supply

For checkout, a reservation-first flow works better than a traditional cart. When a shopper starts payment, the system places a short inventory hold; after payment succeeds, the hold becomes a committed order. If payment fails or times out, the inventory returns automatically without requiring the vendor to reconcile counts by hand.

## Payments and Fulfillment

Payments should support split settlement because a single basket may include products from several farms. The marketplace can collect one shopper payment, then allocate vendor payouts after fees, refunds, and no-show rules are applied. Fulfillment is usually simplest with QR-code check-in at the stall, backed by a vendor dashboard that shows paid, picked up, refunded, and substituted orders.

## Operational Lessons

The most useful features are rarely flashy. Vendors need fast quantity edits, duplicate-last-week inventory, printable pickup lists, and clear alerts when an item is close to selling out. Shoppers need accurate pickup instructions and confidence that the carrots they reserved will actually be waiting for them.