Manapool Seller Fulfillment Service

Lightweight microservice that automates the seller workflow for Manapool orders. Personal card inventory (ManaBox) sold via the Dungeon Books seller account on Manapool.

Problem

Orders come in via email only — no seller API or webhook from Manapool. Manual process: check email, log into dashboard, print packing slip, find card, package, ship. Easy to miss or delay.

Architecture

Standalone Python + FastAPI service (same stack as marty), deployed separately on Railway.

Gmail API (poll for Manapool sale emails)
  → parse order details
  → create order in TCGTracking (label + tracking)
  → post Discord webhook embed to #orders channel

Components

ModuleResponsibility
gmail.pyGmail API polling, email parsing
tcgtracking.pyTCGTracking REST API — order creation, label generation, tracking
discord.pyDiscord webhook — order notification embeds
main.pyFastAPI app, scheduled polling

Integrations

ServiceRoleAPI?
ManapoolOrder sourceNo seller API — parse email notifications
GmailEmail inboxYes — Gmail API (OAuth)
TCGTrackingShipping labels + trackingYes — REST API (free)
DiscordNotificationsWebhook (no bot needed)
ManaBoxCard inventory (source of truth)No API — stays manual
PirateshipShipping labels (alternative)Yes — but TCGTracking may cover this

Email Format (Manapool)

Subject: Mana Pool - You Made a Sale - Order #<number> From: noreply@manapool.com via Mailgun (mg.manapool.com)

Parseable fields from plaintext body:

  • Order UUID (from fulfill URL)
  • Card name, set code, collector number, finish, condition, language
  • Quantity and price
  • Sale date
  • Order number
  • Minimum shipping method

Discord Notification

Embed includes:

  • Order number + fulfill link
  • Card details (name, set, condition, qty, price)
  • Shipping method
  • Tracking number (from TCGTracking)
  • ManaBox search hint (card name → move to Orders binder)

Future

  • Marty integration — marty can query this service (or TCGTracking) to answer “what cards are in stock?” without needing to know about Gmail or shipping
  • ManaBox — if they ever release an API, automate inventory moves
  • Multi-card orders — handle orders with multiple line items
  • Manapool seller API — if/when available, replace email parsing

Decisions

  • Separate from marty — different domain (MTG selling vs bookstore chatbot), different lifecycle. Marty can call this service’s API later.
  • Discord webhook over bot — simpler, no dependency on marty’s bot process
  • TCGTracking over Pirateship — purpose-built for TCG sellers, imports Manapool orders directly, free, has REST API
  • Gmail API over Apps Script — keeps everything in one deployable service