Companion App API

Let CineStash, PlayStash or any collection app keep a user's DiscMarket Trade Booth and Wish List in sync.

Authentication

Accounts connect automatically by the same verified email address. Users do not create API keys. Each companion has a separate server-only signing secret: CINESTASH_SYNC_SECRET or PLAYSTASH_SYNC_SECRET on DiscMarket, with the matching value stored securely on the companion.

Sign the exact raw request body as HMAC-SHA256(secret, timestamp + "." + body) using Web Crypto. The timestamp is Unix seconds; signatures expire after five minutes. Read the account id, verified email and items from trusted server-side account data, never from client-submitted identity fields.

Endpoints

  • POST /api/public/companions/cinestash/sync — full movie trade stack and wish-list snapshot.
  • POST /api/public/companions/playstash/sync — full game trade stack and wish-list snapshot.
  • Known external_id values update in place; missing items are removed only from that companion. Hand-added items and other companions are untouched. Send only trade-designated physical items, not an entire private collection.
  • premium (optional boolean, default false): true while the account has an active paid plan in your app. It turns off DiscMarket ads for the matched member; send a new snapshot when it changes.
  • The increasing integer version identifies a complete snapshot. Retried or older snapshots are ignored. Keep the same body and version when retrying; generate a fresh signature timestamp.
  • A matching verified account receives the snapshot immediately. Otherwise it stays private until that account signs in. Every accepted request returns the same acknowledgement, including paused and pending connections, without revealing account existence.
POST /api/public/companions/cinestash/sync
X-DiscMarket-Timestamp: <Unix seconds>
X-DiscMarket-Signature: <HMAC-SHA256 hex>
Content-Type: application/json

{
  "source_user_id": "<verified source account id>",
  "email": "collector@example.com",
  "email_verified": true,
  "version": 1795932000000,
  "premium": true,
  "items": [
    { "external_id": "c0ffee-123", "list": "booth", "media": "movie",
      "title": "The Thing", "release_year": 1982, "format": "4K UHD",
      "condition": "Like New", "upc": "025192395245",
      "cover_url": "https://image.tmdb.org/t/p/w500/x.jpg", "notes": "Steelbook" },
    { "external_id": "wish-88", "list": "wish", "media": "movie",
      "title": "Alien", "format": "4K UHD" }
  ]
}

→ 202 { "accepted": true }

Fields

  • Required: external_id (your stable id, ≤120 chars), list (booth | wish), media (movie | game), title.
  • Movies: format (4K UHD, Blu-ray, DVD, VHS, Steelbook). Games: platform (e.g. PS2, SNES, Nintendo Switch).
  • Optional: release_year, condition (games: Sealed, CIB (Complete in Box), Box + Game, Loose Cartridge/Disc), upc (digits), cover_url (https), notes.
  • Up to 5,000 items and 8 MB per complete snapshot. Never split a snapshot into separate full-sync calls: each call replaces the source list. Prefix stable ids with trade- or wish- if an item can exist in both lists.

Delivery and account changes

Companions should sync after sign-in and every trade or wish-list change, with a durable server-side outbox and retry handling. Failed reads must never turn into an empty snapshot. An already connected source account cannot be reassigned to another market account by changing its email.

HTTP 400 means invalid data, 401 invalid or expired signature, 409 conflicting account binding, 413 oversized body, and 503 missing owner configuration. Do not retry permanent errors without correcting them. Legacy per-user-key endpoints at /api/public/v1/* remain compatible for existing integrations only.

Prices are set by members inside DiscMarket, not through the sync. Exact locations are never exposed through the API.