tinyfiles.tv
← Back to listingsDemo only · Nothing is published for real

Add a new listing

Start with the obvious, then add the details buyers actually ask about. You can save as draft anytime.

Listing type

What kind of listing is this? This changes which fields matter.

Physical good: needs shipping, weight, dimensions, quantity, condition.

Photos

Add at least one photo. Use all five photos to show different angles and details.

Use high-quality JPG, PNG, or GIF files that are at least 570px wide (we recommend 1000px).
The best photos use natural or diffused lighting, and do not use a flash.
These are thumbnails of your photos. Zoom in to see them full-size.
Demo: photos stay in your browser, they are not uploaded.

Listing details

Describe your item so buyers know what makes it special.

Inventory & pricing

Factor in the costs of materials and labor, plus any related business expenses.


Variations

Optional. Variations let buyers pick size, color, or style without you making a new listing for each one.

Example: Color = Green, Extra price = 0, Quantity = 3

Shipping

Buyers need to know how fast it ships and what it costs to get to them.


Returns & exchanges

Set expectations up front, so there are no surprises later.

Preview

This is how buyers will see the top of your listing.

No photo
Your title will show here
$0.00  New
Category · Qty 1
Description preview...
Fill in Title, Price, Quantity, Category, and Description, then Preview, Save as draft, or Publish in demo.
Backend  ·  Template · Proposed · Not connected

Backend, New Listing Backend, Template

Right now new listing is a single page form plus demo validation, preview, draft, publish, no listing created, no photos uploaded, no payment taken. This backend is the map to make it real: create listing, save photos, save variations, save shipping, save returns. Proposed, not connected.

01 / Files to create
api/marketplace/listings.php      POST /api/marketplace/listings
api/marketplace/listing_photos.php POST /api/marketplace/listing_photos
api/marketplace/variations.php     POST /api/marketplace/variations
sql/marketplace_tables.sql

Keep the tinyfiles PHP pattern: /api/bootstrap.php, json_in() / json_out(), prepared PDO.

02 / Database tables
marketplace_listings
  id BIGINT AUTO_INCREMENT PRIMARY KEY
  shop_id BIGINT NOT NULL
  listing_type VARCHAR(30) NOT NULL
  title VARCHAR(140) NOT NULL
  who_made_it VARCHAR(50) NOT NULL
  what_is_it VARCHAR(50) NOT NULL
  when_made VARCHAR(50) NOT NULL
  category VARCHAR(100) NOT NULL
  subcategory VARCHAR(100) NULL
  brand VARCHAR(100) NULL
  color VARCHAR(100) NULL
  size VARCHAR(100) NULL
  age_range VARCHAR(20) NULL
  description TEXT NOT NULL
  materials TEXT NULL
  tags TEXT NULL
  safety TEXT NULL
  price_cents INT NOT NULL
  sale_price_cents INT NULL
  currency VARCHAR(10) NOT NULL DEFAULT 'USD'
  quantity INT NOT NULL DEFAULT 1
  sku VARCHAR(100) NULL
  upc VARCHAR(100) NULL
  condition_text VARCHAR(50) NOT NULL
  renewal VARCHAR(30) NOT NULL
  visibility VARCHAR(30) NOT NULL DEFAULT 'draft'
  weight_lb DECIMAL(8,2) NULL
  length_in DECIMAL(8,2) NULL
  width_in DECIMAL(8,2) NULL
  height_in DECIMAL(8,2) NULL
  ships_from VARCHAR(100) NULL
  processing_time VARCHAR(100) NULL
  shipping_profile VARCHAR(100) NULL
  shipping_cost_cents INT NULL
  return_policy VARCHAR(100) NULL
  return_shipping VARCHAR(100) NULL
  return_notes TEXT NULL
  digital_files VARCHAR(255) NULL
  digital_size VARCHAR(50) NULL
  status VARCHAR(30) NOT NULL DEFAULT 'draft'
marketplace_listing_photos
  id BIGINT AUTO_INCREMENT PRIMARY KEY
  listing_id BIGINT NOT NULL
  sort_order INT NOT NULL DEFAULT 0
  file_path VARCHAR(255) NOT NULL
  alt_text VARCHAR(255) NULL

marketplace_variations
  id BIGINT AUTO_INCREMENT PRIMARY KEY
  listing_id BIGINT NOT NULL
  name VARCHAR(100) NOT NULL
  options TEXT NOT NULL
  extra_price_cents INT NOT NULL DEFAULT 0
  quantity INT NOT NULL DEFAULT 0
03 / API endpoints
POST /api/marketplace/listings
{ "title": "Green and Gold Anniversary Console", "price_cents": 12000, "quantity": 1, "category": "Toys & Games", "description": "..." }
- validates title 1 to 140, price > 0, quantity >= 0, description 50+
- creates listing as draft, returns id

POST /api/marketplace/listings/{id}/publish
- checks title, price, quantity, category, description, at least 1 photo
- moves draft to public, sets published_at

POST /api/marketplace/listing_photos
- multipart, max 5 photos, JPG PNG GIF, max 10 MB each, min 570px wide
- stores file, saves alt_text, sort_order

Draft saves often. Publish checks everything. Never trust client price alone, re-check on server.

04 / Cooldown, moderation and validation
// Cooldown: 1 listing create per 30s, 1 publish per 30s, 1 photo per 5s
// Validation: title 1 to 140, description 50+, price > 0, quantity >= 0, tags max 13
// Safety: escape output, prepared statements, never log prices as floats, use cents
// Moderation: block prohibited items, check photos for personal data, hold for review if flagged
// Privacy: draft is shop only, unlisted is link only, public is search

Keep disclaimer until this ships: Tinker toy, not live yet.

05 / Frontend wiring
// On Title input: update count, update preview
// On Price / Quantity / Category / Description: update preview
// On Add photo: read file, show thumbnail, keep in browser only in demo
// On Save as draft: validate basics, POST /api/marketplace/listings, show draft saved
// On Publish: validate all required, show error list, else POST publish, go to listing page
// If API fails, fall back to local demo plus disclaimer.
Copy snippets into api/marketplace/ plus sql/marketplace_tables.sql, no GitHub needed. New listing stays safe by never uploading photos for real in demo, never charging a real fee in demo, and never publishing for real until backend ships.