{"openapi":"3.0.3","info":{"title":"ParseDoc — Receipt & Invoice → JSON","version":"1.0.0","description":"Parse receipts and invoices (image/PDF) into strict structured JSON. Payment: x402 ($0.02/page, USDC on eip155:8453, payTo 0xDf3aFe9e7DF48647f5F49023c6254f2ff6eEB36a) or RapidAPI subscription. Settlement only on successful responses."},"servers":[{"url":"https://parsedoc.wrapper-agency.com"}],"paths":{"/api/v1/parse":{"post":{"summary":"Parse a document (x402 paid, $0.02/page)","description":"Returns HTTP 402 with payment requirements if no valid X-PAYMENT header. Pay with any x402 client (USDC on Base).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","description":"HTTP(S) URL of the receipt/invoice (image or PDF, max 8MB)"},"image_base64":{"type":"string","description":"Base64-encoded document (alternative to image_url)"},"media_type":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif","application/pdf"],"description":"Required with image_base64"}}}}}},"responses":{"200":{"description":"Parsed document","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"document":{"type":"object","properties":{"document_type":{"type":"string","enum":["receipt","invoice","other"]},"merchant":{"type":"object","properties":{"name":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"tax_id":{"type":"string","nullable":true}},"required":["name","address","phone","tax_id"]},"date":{"type":"string","nullable":true},"time":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"line_items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number","nullable":true},"unit_price":{"type":"number","nullable":true},"total":{"type":"number","nullable":true}},"required":["description","quantity","unit_price","total"]}},"subtotal":{"type":"number","nullable":true},"tax":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"amount":{"type":"number","nullable":true}},"required":["rate","amount"]}},"tip":{"type":"number","nullable":true},"total":{"type":"number","nullable":true},"payment_method":{"type":"string","nullable":true},"invoice_number":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"confidence":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["document_type","merchant","date","time","currency","line_items","subtotal","tax","tip","total","payment_method","invoice_number","category","confidence","warnings"]},"meta":{"type":"object","properties":{"provider":{"type":"string"},"latency_ms":{"type":"number"},"version":{"type":"string"}}}}}}}},"400":{"description":"Invalid input"},"402":{"description":"Payment required (x402 protocol)"}}}},"/api/demo":{"post":{"summary":"Free demo (3/day per IP, images only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","description":"HTTP(S) URL of the receipt/invoice (image or PDF, max 8MB)"},"image_base64":{"type":"string","description":"Base64-encoded document (alternative to image_url)"},"media_type":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif","application/pdf"],"description":"Required with image_base64"}}}}}},"responses":{"200":{"description":"Parsed document","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"document":{"type":"object","properties":{"document_type":{"type":"string","enum":["receipt","invoice","other"]},"merchant":{"type":"object","properties":{"name":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"tax_id":{"type":"string","nullable":true}},"required":["name","address","phone","tax_id"]},"date":{"type":"string","nullable":true},"time":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"line_items":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number","nullable":true},"unit_price":{"type":"number","nullable":true},"total":{"type":"number","nullable":true}},"required":["description","quantity","unit_price","total"]}},"subtotal":{"type":"number","nullable":true},"tax":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"amount":{"type":"number","nullable":true}},"required":["rate","amount"]}},"tip":{"type":"number","nullable":true},"total":{"type":"number","nullable":true},"payment_method":{"type":"string","nullable":true},"invoice_number":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"confidence":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["document_type","merchant","date","time","currency","line_items","subtotal","tax","tip","total","payment_method","invoice_number","category","confidence","warnings"]},"meta":{"type":"object","properties":{"provider":{"type":"string"},"latency_ms":{"type":"number"},"version":{"type":"string"}}}}}}}},"429":{"description":"Demo limit reached"}}}}}}