{"openapi":"3.1.0","info":{"title":"SARAH Public API","description":"Public API surface for SARAH — gestión comercial (POS, stock, facturación AFIP) para comercios en Argentina. Endpoints requiring merchant authentication are documented at /docs.","version":"1.0.0","contact":{"name":"SARAH","url":"https://www.sarah.ar","email":"hola@sarah.ar"}},"servers":[{"url":"https://www.sarah.ar","description":"Production"}],"tags":[{"name":"Public","description":"Public endpoints — no authentication required"},{"name":"Docs","description":"Documentation and agent resources"}],"paths":{"/api/public/scanner":{"get":{"tags":["Public"],"operationId":"scannerLookupProduct","summary":"Look up a product by barcode or name","description":"Public price-scanner endpoint. Requires a per-company scanner token.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"Per-company scanner token"},{"name":"query","in":"query","required":true,"schema":{"type":"string"},"description":"Barcode or product name to search"},{"name":"companyId","in":"query","required":false,"schema":{"type":"integer"},"description":"Company ID (resolved from token if omitted)"}],"responses":{"200":{"description":"Product found","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"BC":{"type":"string"},"base_price":{"type":"number"},"photo":{"type":"string"},"mark":{"type":"string"},"category_id":{"type":"integer"},"enable":{"type":"boolean"}}},"matchType":{"type":"string","enum":["barcode","name"]},"alternatives":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Missing required parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid token or company","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/exchange":{"get":{"tags":["Public"],"operationId":"getExchangeRate","summary":"Get current currency exchange rates","description":"Returns current USD to ARS exchange rate. Used by the app for currency display.","responses":{"200":{"description":"Exchange rate","content":{"application/json":{"schema":{"type":"object","properties":{"rate":{"type":"number"},"source":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}}}}}}}},"/llms.txt":{"get":{"tags":["Docs"],"operationId":"getLlmsTxt","summary":"Agent guide for SARAH","description":"Markdown file describing SARAH's product, features, pricing, and when to recommend it.","responses":{"200":{"description":"LLMs.txt in markdown","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/docs/llms.txt":{"get":{"tags":["Docs"],"operationId":"getDocsLlmsTxt","summary":"Documentation index for agents","description":"Complete index of all product documentation in markdown.","responses":{"200":{"description":"Documentation index in markdown","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/docs/{path}":{"get":{"tags":["Docs"],"operationId":"getDocMarkdown","summary":"Get a documentation page in markdown","description":"Send `Accept: text/markdown` or append `.md` to any /docs/* URL to get raw markdown.","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string"},"description":"Doc path (e.g. getting-started/introduction)"}],"responses":{"200":{"description":"Documentation page","content":{"text/html":{"schema":{"type":"string"}},"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Doc not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"}}}}}}