{"openapi": "3.1.0", "info": {"title": "ToolForge Compliance & Document Utilities API", "version": "1.0.0", "description": "Deterministic REST APIs for Amazon KDP print PDF preflight & spine math, EU EN 16931 e-invoice (Factur-X / ZUGFeRD / XRechnung) validation & XML generation, TikTok Shop / Whatnot / Etsy payout CSV to QuickBooks & Xero double-entry reconciliation, and ADA Title II / PDF/UA accessibility auditing & auto-tagging.", "contact": {"name": "ToolForge Support", "email": "support@takefox.com", "url": "https://tools.takefox.com"}}, "servers": [{"url": "https://tools.takefox.com", "description": "Production"}], "components": {"securitySchemes": {"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-API-Key"}, "RapidApiProxySecret": {"type": "apiKey", "in": "header", "name": "X-RapidAPI-Proxy-Secret"}}}, "security": [{"ApiKeyAuth": []}, {"RapidApiProxySecret": []}], "paths": {"/api/v1/kdp/spine": {"post": {"summary": "Calculate Amazon KDP bleed size, gutter margin & cover spine width", "security": [], "requestBody": {"required": true, "content": {"application/json": {"example": {"trim_size": "6x9", "page_count": 240, "bleed": true, "paper": "white"}}}}, "responses": {"200": {"description": "Exact KDP print dimensions and margins"}}}}, "/api/v1/kdp/preflight": {"post": {"summary": "Preflight a base64 PDF against Amazon KDP trim, bleed & gutter rules", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>", "trim_size": "6x9", "bleed": true}}}}, "responses": {"200": {"description": "KDP preflight diagnostic JSON"}}}}, "/api/v1/einvoice/validate": {"post": {"summary": "Validate Factur-X, ZUGFeRD or XRechnung XML/PDF against EN 16931", "requestBody": {"required": true, "content": {"application/json": {"example": {"profile": "facturx-en16931", "xml": "<rsm:CrossIndustryInvoice .../>"}}}}, "responses": {"200": {"description": "EN 16931 BT-1..BT-115 validation report"}}}}, "/api/v1/einvoice/generate": {"post": {"summary": "Generate compliant EN 16931 Factur-X / XRechnung CII XML from JSON fields", "requestBody": {"required": true, "content": {"application/json": {"example": {"profile": "facturx-en16931", "invoice_number": "INV-2026-1001", "issue_date": "2026-12-03", "currency": "EUR", "seller_name": "Acme Studio LLC", "seller_vat": "DE298765432", "buyer_name": "Muster GmbH", "tax_basis": "1000.00", "tax_rate": "19.00", "tax_total": "190.00", "grand_total": "1190.00"}}}}, "responses": {"200": {"description": "Generated EN 16931 XML and validation status"}}}}, "/api/v1/payout/reconcile": {"post": {"summary": "Reconcile TikTok Shop, Whatnot, Faire or Etsy payout CSV to QuickBooks & Xero journals", "requestBody": {"required": true, "content": {"application/json": {"example": {"platform": "auto", "csv_text": "Settlement Date,Subtotal after seller discounts,TikTok Shop commission fee,Total settlement amount\n2026-11-30,100.00,-8.00,92.00"}}}}, "responses": {"200": {"description": "Balanced double-entry JSON + QBO and Xero CSV exports"}}}}, "/api/v1/ada-pdf/audit": {"post": {"summary": "Audit a base64 PDF for ADA Title II, WCAG 2.1 AA and PDF/UA compliance (0-100 score)", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>"}}}}, "responses": {"200": {"description": "PDF/UA compliance score and issue list"}}}}, "/api/v1/ada-pdf/remediate": {"post": {"summary": "Auto-tag a base64 PDF with PDF/UA StructTreeRoot, /Lang, DisplayDocTitle & XMP", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>", "doc_lang": "en-US", "doc_title": "Public Notice"}}}}, "responses": {"200": {"description": "Remediated base64 PDF and before/after certificate"}}}}, "/api/v1/bank-statement/extract": {"post": {"summary": "Extract transactions, balance reconciliation, CSV & QuickBooks .QBO from a bank statement PDF", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>", "currency": "auto"}}}}, "responses": {"200": {"description": "Reconciled transactions, CSV, and QuickBooks .QBO string"}}}}, "/api/v1/pdf/to-markdown": {"post": {"summary": "Convert complex PDF & tables into clean Markdown, structured tables, and RAG JSON chunks", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>", "chunk_size": 1000}}}}, "responses": {"200": {"description": "Clean Markdown, extracted tables, and RAG JSON chunks"}}}}, "/api/v1/receipts/extract": {"post": {"summary": "Extract vendor, date, VAT/tax, subtotal, total & tax category from PDF or ZIP of receipts", "requestBody": {"required": true, "content": {"application/json": {"example": {"pdf_base64": "<BASE64_PDF>", "currency": "USD"}}}}, "responses": {"200": {"description": "Structured receipt/invoice records and tax totals"}}}}}}