runbookify
← All plans
Order Management & Fulfillment / Order Changes & Cancellations

Order Cancellation Handler

Process order cancellations cleanly - full or per-line - block anything already shipped, capture the reason code, and fire the refund/credit hook only after a person approves. No more cancellations processed too late or with no record of why.

BeginnerAn afternoonBuilds onNext.js (App Router) on VercelSupabase (Postgres + Auth + RLS)Resend (email notifications)
What you'll build

A small internal web tool where a CSR requests a cancellation (whole order or specific lines), the tool blocks any line that has already shipped, an agent approves it with a reason, and only then does it mark the order canceled, fire your refund/credit hook, and write a permanent audit log.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.

Before you start

  • A free Vercel account
  • A free Supabase account
  • A free Resend account
  • An export of your open orders with fulfillment status (CSV or Google Sheet)
  • Your list of cancel reason codes

The problem this kills

Cancellations are where order desks quietly leak money and trust. A customer calls to cancel; the CSR fires off an email or a Slack ping; meanwhile the warehouse has already picked, packed, and handed the box to the carrier. Now you're chasing a refund on something that's in a truck, the customer is annoyed, and nobody can say who approved what or why.

The other failure mode is the opposite: the cancellation sits in someone's inbox for two days, the order ships anyway, and you eat the return. Either way the root cause is the same - there's no single place where a cancel request is checked against fulfillment status, approved by a real person, and recorded.

This tool makes cancellations boring and safe: check the stage, block what's shipped, get a human yes with a reason, then commit.

What you'll build

A clean internal web app your team logs into:

  • A CSR pulls up an order and requests a cancellation - the whole order or just specific lines (partial cancellation is built in).
  • The tool checks each line's fulfillment stage and automatically blocks any line that has already shipped, with a clear message about why.
  • The request lands in an approval queue. An agent reviews it, picks a reason code, and approves (or rejects).
  • On approval, the tool marks the line(s) canceled, fires your refund/credit hook, emails a confirmation, and writes a permanent audit entry.
  • A duplicate guard keyed on order ID + line means the same cancellation can't be processed twice.

If you don't have an order API to plug into yet, you start by importing a CSV or Google Sheet of open orders and export a clean canceled-orders CSV in exactly the columns your system of record expects. The tool is fully usable today.

What's inside the Implementation Plan

The plan is a single file you paste into an AI coding agent (Claude Code), and it builds the tool with you step by step. Crucially, it opens by interviewing you about your actual business - your order systems, your real field and SKU naming, your fulfillment stages, your approval rules, your reason codes, and your messy edge cases - then it tailors the data model and every later step to your answers. You're not getting a generic template; you're getting a tool shaped around how your order desk really works.

Inside you'll find: the discovery interview, a definition of done, the exact stack, an architecture diagram, and a sequence of build steps that each end with a ready-to-paste prompt. It closes with a verification checklist and the CSV-export fallback so you can ship even with no integration.

The governance it includes (this is the point)

  • Login so only your team can touch it.
  • Row-level security so people only ever see their own organization's orders.
  • A hard human approval gate - the tool drafts the cancellation and confirms the line isn't shipped, but a person must approve with a reason before anything is committed or refunded.
  • A complete audit trail - who requested, who approved, when, and the reason for every cancellation.
  • Duplicate guards keyed on order ID + line so a cancel can't be double-processed.

Who it's for

Customer service reps who take the cancel requests, fulfillment teams who need shipped lines protected, and accounts-receivable staff who own the refund and credit side. If cancellations in your shop are handled over email and good intentions, this is for you.

You've got this - paste the first prompt and let the agent interview you.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.