{"openapi":"3.1.0","info":{"title":"CSV Clinic Paid Downloads and Preflight API","version":"1.3.0","description":"Check CSV structure before Shopify/product imports: row widths, blank or duplicate rows, whitespace, formula-like cells, and header issues. Optionally flag blank values in caller-specified required columns. Returns counts and row/column positions, not cell values. Up to 256 KiB; requests are processed in memory and not intentionally stored or logged. The API processes one request in memory. It does not intentionally persist or log request bodies, and its report never returns cell contents. Do not send sensitive data.","contact":{"email":"csvclinicagent@atomicmail.ai"},"x-guidance":"Use this API when an agent needs a structural check before importing a Shopify or product CSV, or help interpreting a Shopify product CSV import error. For error decoding, send only short, redacted error_text; the response gives a deterministic heuristic match or no-match, safe next checks, official Shopify help links, confidence, and scope. It does not access a store or inspect a CSV. For preflight, send one CSV up to 256 KiB, an optional delimiter, and optional required_columns; the response returns structural counts and row/column locations, never cell values. Formula-like detection is heuristic. Requests are processed in memory and request bodies are not intentionally stored or logged. Do not send personal or sensitive data. The decoder and preflight each cost $0.005 USDC per call via x402 on Base."},"externalDocs":{"description":"Agent-readable endpoint, schema, price, and privacy documentation","url":"https://csv-clinic.bakongi.chatgpt.site/llms.txt"},"servers":[{"url":"https://csv-clinic.bakongi.chatgpt.site"}],"paths":{"/api/shopify/import-error":{"post":{"summary":"Decode a Shopify product CSV import error for an agent workflow","description":"Pass only short, redacted error text. Returns a deterministic heuristic match, safe next checks, Shopify help links, confidence and scope. It does not access a Shopify store or inspect a CSV. $0.005 USDC on Base per request through x402, including when no rule matches.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["error_text"],"properties":{"error_text":{"type":"string","minLength":1,"maxLength":2000,"description":"Short, redacted Shopify product CSV import error text. Do not include store or customer data."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Deterministic heuristic diagnosis, including an explicit no-match result when no rule fits","content":{"application/json":{"schema":{"type":"object","required":["service","version","matched","rule_id","title","explanation","confidence","next_checks","sources","scope"],"properties":{"service":{"type":"string"},"version":{"type":"string"},"matched":{"type":"boolean"},"rule_id":{"type":["string","null"]},"title":{"type":"string"},"explanation":{"type":"string"},"confidence":{"type":"string","enum":["heuristic_match","unknown"]},"next_checks":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object","required":["title","url"],"properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"additionalProperties":false}},"scope":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid JSON or missing error_text"},"402":{"description":"Payment required (x402)"},"413":{"description":"Request or error text exceeds the documented limit"},"415":{"description":"Content-Type must be application/json"}}}},"/api/csv/preflight":{"post":{"summary":"Preflight a Shopify product CSV or spreadsheet export","description":"Check CSV structure before Shopify/product imports: row widths, blank or duplicate rows, whitespace, formula-like cells, and header issues. Optionally flag blank values in caller-specified required columns. Returns counts and row/column positions, not cell values. Up to 256 KiB; requests are processed in memory and not intentionally stored or logged. $0.005 USDC on Base per request through x402.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"type":"string","description":"CSV document, up to 256 KiB."},"delimiter":{"type":"string","enum":[",",";","tab","|"],"description":"Optional delimiter; defaults to automatic detection."},"required_columns":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1},"description":"Optional header names whose values must not be blank; matching ignores surrounding whitespace and case."}},"additionalProperties":false}}}},"responses":{"200":{"description":"CSV preflight report; counts and row/column positions only, with no cell values","content":{"application/json":{"schema":{"type":"object","required":["service","valid_csv","status","input_bytes","rows","columns","delimiter","blank_rows","duplicate_rows","trimmed_cells","formula_like_cell_count","formula_like_cells","row_width_mismatch_count","row_width_mismatches","empty_header_columns","duplicate_header_groups","required_columns_not_found","blank_required_cell_count","blank_required_cells","note"],"properties":{"service":{"type":"string","const":"CSV Clinic Preflight API"},"valid_csv":{"type":"boolean","const":true,"description":"True means the CSV parsed; it does not mean the file is safe to import."},"status":{"type":"string","enum":["ok","warnings"]},"input_bytes":{"type":"integer","minimum":1,"maximum":262144},"rows":{"type":"integer","minimum":0},"columns":{"type":"integer","minimum":1},"delimiter":{"type":"string","enum":["comma","semicolon","tab","pipe"]},"blank_rows":{"type":"integer","minimum":0},"duplicate_rows":{"type":"integer","minimum":0},"trimmed_cells":{"type":"integer","minimum":0},"formula_like_cell_count":{"type":"integer","minimum":0,"description":"Cells beginning with =, +, or @; heuristic only."},"formula_like_cells":{"type":"array","maxItems":20,"items":{"type":"object","required":["row","column"],"properties":{"row":{"type":"integer","minimum":2},"column":{"type":"integer","minimum":1}},"additionalProperties":false}},"row_width_mismatch_count":{"type":"integer","minimum":0},"row_width_mismatches":{"type":"array","maxItems":20,"items":{"type":"object","required":["row","expected_columns","actual_columns"],"properties":{"row":{"type":"integer","minimum":2},"expected_columns":{"type":"integer","minimum":1},"actual_columns":{"type":"integer","minimum":0}},"additionalProperties":false}},"empty_header_columns":{"type":"array","items":{"type":"integer","minimum":1}},"duplicate_header_groups":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"integer","minimum":1}}},"required_columns_not_found":{"type":"array","items":{"type":"integer","minimum":1,"maximum":100},"description":"1-based positions in required_columns that did not match a header."},"blank_required_cell_count":{"type":"integer","minimum":0},"blank_required_cells":{"type":"array","maxItems":20,"items":{"type":"object","required":["row","column"],"properties":{"row":{"type":"integer","minimum":2},"column":{"type":"integer","minimum":1}},"additionalProperties":false}},"note":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid request"},"402":{"description":"Payment required (x402)"},"422":{"description":"Malformed CSV"}}}},"/api/download/shopify-safe-update-kit.zip":{"get":{"summary":"Download the Shopify CSV Safe Update Kit","description":"After a 3.00 USDC Base x402 payment, downloads a ZIP containing a local Python structural preflight, a change-log template, synthetic CSV, and instructions.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USDC","amount":"3.00"}},"parameters":[{"name":"edition","in":"query","required":false,"description":"The current kit release; omit to receive the latest edition.","schema":{"type":"string","enum":["latest"],"default":"latest"}}],"responses":{"200":{"description":"Paid digital kit","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"402":{"description":"Payment required (x402)"}}}},"/api/download/eu-product-id-starter-kit.zip":{"get":{"summary":"Download the EU product identifier supplier request starter kit","description":"After a 3.00 USDC Base x402 payment, downloads a ZIP with a supplier request template, product/variant tracker, correction log, synthetic sample, and human review checklist. Not legal or customs advice.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USDC","amount":"3.00"}},"responses":{"200":{"description":"Paid digital kit","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"402":{"description":"Payment required (x402)"}}}},"/api/download/inventory-reorder-planner-kit.zip":{"get":{"summary":"Download the Inventory Reorder Planner Kit","description":"After a 2.00 USDC Base x402 payment, downloads an offline Python CSV calculator, input template, fictional sample, calculation guide, and purchasing review logs. Estimates only; human review required.","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USDC","amount":"2.00"}},"responses":{"200":{"description":"Paid digital kit","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"402":{"description":"Payment required (x402)"}}}}}}