{"openapi":"3.0.3","info":{"title":"ReceiptConverter API","description":"Receipt OCR API — convert receipt and invoice images or PDFs into structured JSON using AI. Accepts file uploads or public image URLs. Extract vendor, date, line items, taxes, tip, and totals in a single request.","version":"1.0.0","contact":{"url":"https://receiptconverter.com","email":"hello@receiptconverter.com"},"x-llms-txt":"https://receiptconverter.com/llms-full.txt"},"servers":[{"url":"https://receiptconverter.com/api/v1","description":"Production"}],"security":[{"BearerAuth":[]}],"paths":{"/convert":{"post":{"summary":"Convert a receipt or invoice image to structured JSON","description":"Upload a receipt image or PDF and receive structured JSON including vendor name, transaction date, individual line items with quantities and prices, tax lines, tip, and grand total. Accepts multipart/form-data (file upload) or application/json (hosted URL). One credit is consumed per successful conversion.","operationId":"convert_receipt","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Receipt image or PDF (max 10 MB)"},"file_name":{"type":"string","description":"Optional filename hint"}}}},"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"Publicly accessible URL of the receipt image or PDF"},"file_name":{"type":"string","description":"Optional filename hint"}}}}}},"responses":{"200":{"description":"Receipt successfully converted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertSuccess"}}}},"400":{"description":"Invalid file, file too large, unsupported type, or scanned PDF"},"401":{"description":"Missing or invalid API key"},"422":{"description":"File is not a receipt or invoice"},"429":{"description":"Monthly conversion limit reached"},"500":{"description":"Internal conversion error"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Your API key starting with `sk_live_`. Generate one from your dashboard."}},"schemas":{"ConvertSuccess":{"type":"object","description":"Successful receipt conversion response.","properties":{"success":{"type":"boolean","example":true,"description":"Always true on a 200 response."},"processing_ms":{"type":"integer","example":1240,"description":"Time taken to process the receipt in milliseconds."},"conversions_used":{"type":"integer","example":3,"description":"Total conversions used this calendar month, including this one."},"conversions_limit":{"type":"integer","example":100,"description":"Your monthly conversion limit based on your plan."},"data":{"$ref":"#/components/schemas/ReceiptData","description":"The structured receipt data extracted from the image."}}},"ReceiptData":{"type":"object","description":"Structured data extracted from the receipt or invoice.","properties":{"vendor":{"type":"string","nullable":true,"example":"Whole Foods Market","description":"Merchant or vendor name as printed on the receipt."},"date":{"type":"string","nullable":true,"example":"2024-03-15","description":"Transaction date. ISO 8601 format when available, otherwise the raw string from the receipt."},"total":{"type":"number","example":47.83,"description":"Grand total amount paid, including taxes and tip."},"subtotal":{"type":"number","nullable":true,"example":43.5,"description":"Pre-tax subtotal. Null if not explicitly shown on the receipt."},"currency":{"type":"string","example":"USD","description":"ISO 4217 currency code detected from the receipt (e.g. USD, EUR, GBP)."},"payment_method":{"type":"string","nullable":true,"example":"Visa ****4242","description":"Payment method as shown on the receipt (e.g. card type and last 4 digits)."},"category":{"type":"string","nullable":true,"example":"Groceries","description":"Auto-detected expense category (e.g. Groceries, Dining, Travel, Office Supplies)."},"tip":{"type":"number","nullable":true,"example":0,"description":"Tip or gratuity amount. Null if not present on the receipt."},"taxes":{"type":"array","description":"Array of tax lines found on the receipt. Each entry has a label and an amount.","items":{"$ref":"#/components/schemas/TaxLine"}},"items":{"type":"array","description":"Individual line items from the receipt. Each entry includes the item name, quantity, unit price, and line total.","items":{"$ref":"#/components/schemas/ReceiptItem"}}}},"TaxLine":{"type":"object","description":"A single tax or fee line on the receipt.","properties":{"label":{"type":"string","example":"Sales Tax","description":"Tax name or label as shown on the receipt (e.g. Sales Tax, VAT, GST)."},"amount":{"type":"number","example":4.33,"description":"Tax amount in the receipt currency."}}},"ReceiptItem":{"type":"object","description":"A single line item from the receipt.","properties":{"name":{"type":"string","example":"Organic Milk 1gal","description":"Item name or description as printed on the receipt."},"quantity":{"type":"number","example":2,"description":"Number of units purchased."},"unit_price":{"type":"number","example":5.99,"description":"Price per individual unit."},"total_price":{"type":"number","example":11.98,"description":"Total price for this line item (quantity × unit price)."}}}}}}