{"openapi":"3.1.0","info":{"title":"Receipt to Ledger API","version":"0.1.0","description":"Pay-per-call API (x402, USDC) that turns messy receipt text into clean ledger JSON: merchant, date, line items, tax, tip, total, a suggested category and a balanced ledger entry. Parsed values and suggested categories are drafts for a person to confirm. Not tax or accounting advice.","x-guidance":"Use POST /v1/parse-receipt with JSON bodies. Unpaid calls receive HTTP 402 with x402 payment terms. See /llms.txt.","termsOfService":"https://ordstirr.com/agents/terms","contact":{"url":"https://ordstirr.com"}},"servers":[{"url":"https://receipts.ordstirr.com"}],"paths":{"/health":{"get":{"operationId":"health","summary":"Free health check","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parse-receipt":{"post":{"operationId":"parseReceiptToLedger","summary":"Turn messy receipt text into ledger JSON (merchant, date, items, tax, tip, total, category, balanced entry) with card and account numbers stripped","description":"Send the text of one receipt. Returns merchant, date, line items, subtotal, tax, tip, total, arithmetic checks, a suggested category and a balanced ledger entry. Card, account and Social Security numbers (plus emails and phone numbers) are removed before parsing and never returned. Suggestions are drafts for a person to confirm. Unpaid calls receive HTTP 402 with x402 payment terms. Invalid input is rejected with HTTP 400 and never charged.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.03"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":6000,"description":"The receipt as plain text, one line per line item. Amounts need cents (12.50)."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO code; default is guessed from the symbols (USD if none)."},"year_hint":{"type":"integer","minimum":1990,"maximum":2100,"description":"Year to use for dates printed without a year."},"date_order":{"enum":["mdy","dmy"],"description":"How to read ambiguous 03/04/2026. Default mdy (US)."},"split_tax":{"type":"boolean","description":"Post sales tax to its own account. Default false."},"payment_account":{"type":"string","maxLength":60,"description":"Ledger account to credit. Default is guessed from the payment method."},"expense_account":{"type":"string","maxLength":60,"description":"Ledger account to debit. Default Expenses:<suggested category>."}},"required":["text"],"additionalProperties":false},"example":{"text":"SHELL OIL 57444\n123 Main St\n11/20/2026 08:15\nUnleaded 12.500 gal  41.25\nTax 0.00\nTOTAL 41.25\nVISA ************1234\n","split_tax":false}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"},"example":{"merchant":"Shell Oil 57444","date":"2026-11-20","currency":"USD","total_cents":4125,"total":"41.25","payment_method":"visa","suggested_category":"Fuel","ledger_entry":{"date":"2026-11-20","payee":"Shell Oil 57444","kind":"purchase","postings":[{"account":"Expenses:Fuel","amount_cents":4125,"amount":"41.25"},{"account":"Liabilities:CreditCard","amount_cents":-4125,"amount":"-41.25"}],"balanced":true},"confidence":"high","redactions":{"card_numbers":1,"ssn":0,"account_numbers":0,"emails":0,"phones":0},"terms_url":"https://ordstirr.com/agents/terms","notice":"Draft - review before filing or booking. Not tax or accounting advice."}}}},"400":{"description":"Invalid input (never charged)"},"402":{"description":"Payment required (x402). See the PAYMENT-REQUIRED header."},"413":{"description":"Request body too large (never charged)"}}}}}}