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
| Module | Responsibility |
|---|---|
gmail.py | Gmail API polling, email parsing |
tcgtracking.py | TCGTracking REST API — order creation, label generation, tracking |
discord.py | Discord webhook — order notification embeds |
main.py | FastAPI app, scheduled polling |
Integrations
| Service | Role | API? |
|---|---|---|
| Manapool | Order source | No seller API — parse email notifications |
| Gmail | Email inbox | Yes — Gmail API (OAuth) |
| TCGTracking | Shipping labels + tracking | Yes — REST API (free) |
| Discord | Notifications | Webhook (no bot needed) |
| ManaBox | Card inventory (source of truth) | No API — stays manual |
| Pirateship | Shipping 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