# Wholesale Form ↔ Cold Box Inventory — Integration Notes

Prep notes for the Tomde + Dan conversation. Goal per Sean: the
wholesale order form (killsboro.com/wholesale-order) and Dan's Cold Box
inventory spreadsheet work as one system — orders flow into the sheet,
availability flows back to the form, sold-out items drop off.

## What exists today (website side)

- **Form, live**: killsboro.com/wholesale-order. Buyer identifies
  business / location / salesperson, sets case quantities per beer,
  notes for kegs. Currently emails the KB team inbox (FormBold).
- **Availability source, current**: the Toast "market" menu (what's
  packaged for the taproom cooler), snapshotted when the site deploys.
  It's a proxy — it knows nothing about wholesale allocations.
- The site is static/serverless (Next.js on Vercel) and can fetch any
  URL at build time or on a timed cache. It already does this pattern
  with Toast and Instagram.

## The two data flows to solve

### 1. Orders INTO the Cold Box sheet (form → Dan)

Options, easiest first:

- **A. FormBold → Google Sheets integration.** The form already posts
  to FormBold; FormBold has a native Sheets integration that appends
  each submission as a row. Zero code. Dan then references that tab
  from Cold Box. Question for Dan: is a raw submissions tab enough, or
  does he need line items split one-row-per-beer? (If split is needed,
  option B.)
- **B. Direct webhook into a Google Apps Script.** Dan publishes a tiny
  Apps Script "web app" URL bound to his spreadsheet; the form POSTs
  JSON to it (one row per beer line, exactly the shape he wants) in
  addition to the email. ~30 lines of Apps Script on his side, one
  fetch call on ours. Most control, still no infrastructure.
- **C. Zapier/Make between FormBold and the sheet** — only if A's shape
  is wrong and B feels like too much. Monthly cost, another account.

### 2. Availability OUT of the Cold Box sheet (Dan → form)

**DECIDED (2026-10-12): the shared sheet carries an "unallocated"
column — that number is what's available for wholesale.** The site
side is already built (`lib/wholesale-stock.ts`): publish the tab via
File → Share → "Publish to web" as CSV, hand Tomde the URL, and the
wholesale form switches from the Toast proxy to the sheet on the next
deploy. Rows with unallocated stock show; everything else drops off.
Column names are matched loosely (any header containing "beer"/"name"
and any containing "unallocated"), so the sheet's exact wording is
flexible.
- **Refresh cadence question for the group**: the site currently
  refreshes data on deploy (house rule: no passive polling). For
  availability, a timed cache (e.g. re-fetch every 15-60 min) is a
  one-line change and probably right for this use case — worth an
  explicit decision on the call.
- Keep Toast out of it once this exists: Cold Box becomes the single
  source of truth for the wholesale form; Toast stays the source for
  taproom (On Tap / Cans To Go) only.

## Decisions needed on the call

1. Sheet shape for incoming orders: one row per order, or per line item?
2. Option A (FormBold→Sheets) or B (Apps Script webhook) for intake?
3. ~~Availability columns~~ DECIDED: the sheet's "unallocated" column
   is the wholesale availability number; site wiring is ready.
4. Refresh cadence for availability on the site (build-time snapshot
   until decided otherwise).
5. Does allocation mean per-account caps? (If yes: v2 — the form could
   show "limit N cases" per beer from the sheet.)

## Meanwhile (per Sean)

Consumer campaign emails don't wait on any of this: the email
template's order section is its own editable block — delete it in
Mailchimp for public sends. The template lives at
killsboro.com/email/kb-template.html.
