{"openapi":"3.1.0","info":{"title":"MCPMails Physical USPS Mail & EDDM Router API","version":"1.2.0","description":"Send real physical USPS letters, Certified Mail (Electronic or Green-Card Return Receipt), full-bleed photo postcards (4x6, 6x9, 6x11), self-mailers, MICR checks, 5,000-recipient Bulk CSV batches, and Every Door Direct Mail (EDDM) street drops end-to-end via REST, Streamable HTTP MCP, Stripe Link, or autonomous HTTP x402 Base Mainnet USDC.","contact":{"name":"MCPMails","url":"https://mcpmails.com/physical","email":"jacksonjezio@gmail.com"},"x-guidance":"MCPMails Physical lets AI agents and humans send real physical USPS mail with zero login required.\nRecommended 3-step autonomous agent flow:\n1. Quote or look up USPS routes: call GET /api/physical/products, POST /api/physical/quote, or GET /api/physical/eddm/routes?q=90068 (all free, no auth).\n2. Stage a mailpiece or EDDM drop: call POST /api/physical/mailpieces (accepts frontImageBase64 photo, PDF, or HTML/text + recipient US address) or POST /api/physical/campaigns/eddm. Returns an order ID, print-ready proofPdfUrl, and exact USD total.\n3. Settle & auto-dispatch: call POST /api/physical/x402/pay with { mailpieceId } or { campaignId } and settle via HTTP x402 USDC on Base Mainnet (eip155:8453), OR call POST /api/physical/mailpieces/{id}/checkout for a Stripe Link / Apple Pay / Card URL. Once payment clears, MCPMails immediately dispatches to live Lob, PostGrid, 4over, or Click2Mail print-and-mail rails.\nMCP clients can also connect directly via Streamable HTTP at https://mcpmails.com/mcp (20 physical USPS tools + email fleet tools)."},"servers":[{"url":"https://mcpmails.com","description":"MCPMails Production"}],"paths":{"/api/physical/x402/pay":{"post":{"operationId":"settlePhysicalMailX402","summary":"Settle and dispatch a physical USPS mailpiece, Bulk CSV batch, or EDDM drop via Base Mainnet USDC (x402)","description":"Autonomous HTTP x402 payment settlement endpoint for physical USPS mail. Unpaid calls return HTTP 402 with exact Base Mainnet USDC payment requirements; paid calls verify on-chain or via x402 facilitator and immediately dispatch the order to live USPS print-and-mail rails.","x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.99","max":"5000.00"},"protocols":[{"x402":{}}]},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mailpieceId":{"type":"string","description":"Staged physical mailpiece ID returned by POST /api/physical/mailpieces (e.g. pmp_...)."},"campaignId":{"type":"string","description":"Staged bulk or EDDM campaign ID returned by POST /api/physical/campaigns/eddm or /bulk."},"txHash":{"type":"string","description":"Optional Base Mainnet ERC-20 USDC transfer transaction hash (0x + 64 hex chars) for direct on-chain verification."},"x402PaymentHeader":{"type":"string","description":"Optional base64-encoded x402 payment payload (alternatively send X-PAYMENT or PAYMENT-SIGNATURE HTTP header)."},"provider":{"type":"string","enum":["auto","lob","postgrid","fourover","click2mail"],"description":"Optional fulfillment rail preference."}}}}}},"responses":{"200":{"description":"USDC payment verified and physical USPS mail order dispatched.","content":{"application/json":{"schema":{"type":"object","properties":{"settled":{"type":"boolean"},"payment":{"type":"object","properties":{"network":{"type":"string","example":"eip155:8453"},"asset":{"type":"string","example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"txHash":{"type":"string"},"explorerUrl":{"type":"string"}}},"mailpiece":{"type":"object"},"campaign":{"type":"object"}}}}}},"402":{"description":"Payment Required — includes x402 v2 PAYMENT-REQUIRED header (eip155:8453 Base Mainnet USDC) and v1 payment instructions."}}}}}}