{"openapi":"3.1.0","info":{"title":"Ethereal AI Media Report Ordering API","version":"1.0.0"},"paths":{"/api/checks":{"post":{"operationId":"run_free_check","summary":"Run free site check","description":"Runs a free automated check on a public business website (or returns Unknown placeholders when only business name and town are provided) and returns three measured or unknown tiles, found business details, a sample report link, and an order pre-fill link. Never takes payment or email.","responses":{"200":{"description":"Free check result payload","content":{"application/json":{"schema":{"type":"object","properties":{"check_id":{"type":"string"},"door":{"type":"string"},"cached":{"type":"boolean"},"stopped_at_ceiling":{"type":"boolean"},"unreadable":{"type":"boolean"},"message":{"type":"string"},"detail":{"type":"string"},"as_of":{"type":"string"},"tiles":{"type":"array","items":{"type":"object"}},"found":{"type":"object"},"teaser":{"type":"string"},"sample_report_url":{"type":"string"},"order_url":{"type":"string"},"chatgpt_listing_notice":{"type":"object"}},"required":["check_id","door","cached","unreadable","message","as_of","tiles","found","teaser","sample_report_url","order_url"]}}}},"400":{"description":"Validation or invalid URL refusal"},"413":{"description":"Request body exceeds 16 KB"},"429":{"description":"Check rate limit exceeded"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_name":{"type":"string"},"business_town":{"type":"string"},"website":{"type":"string"}},"additionalProperties":false}}}}}},"/api/checks/{id}":{"get":{"summary":"Get cached free check by ID","description":"Returns a cached free site check result while within its short TTL.","responses":{"200":{"description":"Cached free check result"},"404":{"description":"Check not found or expired"},"429":{"description":"Check rate limit exceeded"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/catalog":{"get":{"operationId":"get_report_catalog","summary":"Get report catalogue","description":"Returns the Ethereal AI Media base report (where-you-stand, $49.00 USD), optional add-on (hiring-deep-dive, +$10.00 USD), owner intake questions, and delivery target (Usually within the hour (once payment is switched on)).","responses":{"200":{"description":"Catalogue payload","content":{"application/json":{"schema":{"type":"object","properties":{"as_of":{"type":"string"},"currency":{"type":"string"},"base_reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"for_when":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"needs":{"type":"array","items":{"type":"string"}},"covers":{"type":"array","items":{"type":"string"}},"does_not_cover":{"type":"array","items":{"type":"string"}},"price":{"type":"number"}},"required":["id","title","price"]}},"add_ons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"for_when":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"needs":{"type":"array","items":{"type":"string"}},"covers":{"type":"array","items":{"type":"string"}},"does_not_cover":{"type":"array","items":{"type":"string"}},"price":{"type":"number"}},"required":["id","title","price"]}},"questions":{"type":"array","items":{"type":"object"}},"block_questions":{"type":"array","items":{"type":"object"}},"delivery_target":{"type":"string"},"payment_note":{"type":"string"},"custom_request_url":{"type":["string","null"]},"support_email":{"type":["string","null"]}},"required":["as_of","currency","base_reports","add_ons","questions","delivery_target","payment_note"]}}}}}}},"/api/quotes":{"post":{"operationId":"quote_report_order","summary":"Quote a report order","description":"Read-only quote returning line items, owner intake questions, and computed server total in USD ($49.00 USD base, +$10.00 USD add-on).","responses":{"200":{"description":"Quote payload","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"price":{"type":"number"}},"required":["id","kind","title","price"]}},"currency":{"type":"string"},"total":{"type":"number"},"questions_for_owner":{"type":"array","items":{"type":"object"}},"quote_note":{"type":"string"}},"required":["items","currency","total","questions_for_owner","quote_note"]}}}},"400":{"description":"Unknown item or invalid add-on list"},"413":{"description":"Request body exceeds 16 KB"},"429":{"description":"Rate limit exceeded"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_report_id":{"type":"string","enum":["where-you-stand"]},"add_on_ids":{"type":"array","items":{"type":"string","enum":["hiring-deep-dive"]}}},"required":["base_report_id"],"additionalProperties":false}}}}}},"/api/orders":{"post":{"operationId":"order_report","summary":"Place a report order","description":"Places a report order with base_report_id, optional add_on_ids, business, contact, intake, consent_to_email, and owner_confirmed_total ($49.00 USD base, +$10.00 USD add-on). Takes no payment; the owner approves payment on their own device via pay_url. Stops at awaiting_payment.","responses":{"200":{"description":"Existing deduplicated order returned","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"status":{"type":"string"},"door":{"type":"string"},"source":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"price":{"type":"number"}},"required":["id","kind","title","price"]}},"currency":{"type":"string"},"total":{"type":"number"},"pay_url":{"type":"string"},"pay_expires":{"type":"string"},"note":{"type":"string"},"deduplicated":{"type":"boolean"}},"required":["order_id","status","door","source","items","currency","total","pay_url","pay_expires","note"]}}}},"201":{"description":"Order created at awaiting_payment","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"status":{"type":"string"},"door":{"type":"string"},"source":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"title":{"type":"string"},"price":{"type":"number"}},"required":["id","kind","title","price"]}},"currency":{"type":"string"},"total":{"type":"number"},"pay_url":{"type":"string"},"pay_expires":{"type":"string"},"note":{"type":"string"},"deduplicated":{"type":"boolean"}},"required":["order_id","status","door","source","items","currency","total","pay_url","pay_expires","note"]}}}},"400":{"description":"Validation or confirmation error"},"413":{"description":"Request body exceeds 16 KB"},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"src","in":"query","required":false,"schema":{"type":"string"},"description":"Optional attribution tag (prompt)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_report_id":{"type":"string","enum":["where-you-stand"]},"add_on_ids":{"type":"array","items":{"type":"string","enum":["hiring-deep-dive"]}},"business":{"type":"object","properties":{"name":{"type":"string"},"town":{"type":"string"},"trade":{"type":"string"},"website":{"type":"string"}},"required":["name","town","trade"],"additionalProperties":false},"contact":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"intake":{"type":"object","properties":{"competitors":{"type":"string"},"find_competitors_for_me":{"type":"boolean"},"who_you_follow":{"type":"string"},"most_want_to_know":{"type":"string"},"hiring":{"type":"object","properties":{"roles":{"type":"string"},"posted_pay":{"type":"string"},"towns":{"type":"string"}},"additionalProperties":false}},"required":["who_you_follow","most_want_to_know"],"additionalProperties":false},"consent_to_email":{"type":"boolean"},"src":{"type":"string"},"owner_confirmed_total":{"type":"number"}},"required":["base_report_id","business","contact","intake","consent_to_email","owner_confirmed_total"],"additionalProperties":false}}}}}},"/api/orders/{id}":{"get":{"summary":"Check order status by ID","description":"Requires token (Authorization: Bearer, X-Order-Token, or ?t=) or email (X-Order-Email). Never accepts email in the URL.","responses":{"200":{"description":"Order stage and time estimates with zero PII"},"400":{"description":"Email sent in query string"},"404":{"description":"Order not found or credentials do not match"},"429":{"description":"Status rate limit exceeded"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Order-Token","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Order-Email","in":"header","required":false,"schema":{"type":"string"}}]}},"/api/orders/{id}/status":{"post":{"operationId":"get_order_status","summary":"Get order status","description":"Checks order status. Bare order_id opens nothing; order_id plus email returns stage, timing facts, and where_the_report_arrives with zero personal details and zero pay_url; order_id plus token also includes pay_url while awaiting_payment.","responses":{"200":{"description":"Order stage and time estimates with zero PII","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"order_id":{"type":"string"},"status":{"type":"string"},"steps_done":{"type":"array","items":{"type":"string"}},"orders_ahead":{"type":["number","null"]},"usual_minutes_per_report":{"type":["number","null"]},"started_at":{"type":["string","null"]},"ready_by":{"type":["string","null"]},"status_note":{"type":"string"},"where_the_report_arrives":{"type":"string"},"pay_url":{"type":"string"},"report_url":{"type":"string"}},"required":["order_id","status","steps_done","orders_ahead","usual_minutes_per_report","started_at","ready_by","status_note","where_the_report_arrives"]}}}},"404":{"description":"Order not found or credentials do not match"},"413":{"description":"Request body exceeds 16 KB"},"429":{"description":"Status rate limit exceeded"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"token":{"type":"string"}}}}}}}},"/api/reports/{id}":{"get":{"operationId":"get_report","summary":"Get finished report","description":"Retrieves a finished report summary and private report link for a ready order using order_id and token. Refuses awaiting, in-progress, or tokenless lookups.","responses":{"200":{"description":"Finished report summary payload","content":{"application/json":{"schema":{"type":"object","properties":{"report_url":{"type":"string"},"as_of":{"type":"string"},"tiles":{"type":"array","items":{"type":"object"}},"findings":{"type":"array","items":{"type":"object"}},"actions":{"type":"array","items":{"type":"object"}},"limits":{"type":"string"}},"required":["report_url","as_of","tiles","findings","actions","limits"]}}}},"400":{"description":"Email sent in query string"},"404":{"description":"Report not found or credentials do not match"},"429":{"description":"Status rate limit exceeded"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Order-Token","in":"header","required":false,"schema":{"type":"string"}}]}},"/api/openapi.json":{"get":{"summary":"OpenAPI 3.1 specification","description":"Machine-readable API description generated directly from API_ROUTES.","responses":{"200":{"description":"OpenAPI 3.1 JSON document"}}}}}}