← Technical notes

Confidential / NDA

Seller onboarding and product variants

Independent sellers needed to open shops inside an app whose accounts, addresses and categories already existed.

Background

Independent sellers needed to open shops inside an app whose accounts, addresses and categories already existed. Products needed variants (for example size and colour) with their own price and stock.

How it works

  1. The seller applies using an existing account address and payout detail; the application copies them into the shop's default location and payout record.
  2. One shop per account. A rejected application is updated in place and resubmitted, not duplicated.
  3. Admin approves or rejects. Only an active shop can list products.
  4. Categories define attribute templates; the seller fills attributes and defines up to two variant axes.
  5. Every combination of axis values becomes a variant row with its own price and stock. The product keeps a denormalised minimum price for listing pages.
  6. Edits keep existing variant rows where possible, so stock and order references stay stable. Structural edits are blocked while stock is held by an unpaid checkout.

Design decisions

  • Snapshot address and payout details onto the shop at apply time, so later edits to the buyer profile do not silently change the shop.
  • Two fixed variant axes instead of an open-ended axis table: simpler queries and admin UI, matching what sellers actually need.
  • Uniqueness enforced by database constraints (one shop per account, unique slug), with application checks in front.
Loading diagrams…