{"openapi":"3.0.3","info":{"title":"LiquiFact API","version":"1.0.0","description":"Invoice liquidity network on Stellar. SMEs tokenize invoices, investors fund them, and a Soroban escrow contract holds funds until settlement. Escrow contract (testnet): CDQCKR2YU6IVQ4GYPBMXBPZ4FGFQB5H25AI7ZSETHS2CZ5ZRCWQDSO6P"},"servers":[{"url":"https://liquifact-backend.vercel.app"}],"tags":[{"name":"System"},{"name":"Invoices"},{"name":"Escrow"}],"paths":{"/health":{"get":{"tags":["System"],"summary":"Liveness probe","responses":{"200":{"description":"Service is up","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/stats":{"get":{"tags":["System"],"summary":"Marketplace totals","responses":{"200":{"description":"Totals"}}}},"/api/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["open","funded","settled","cancelled"]}}],"responses":{"200":{"description":"Invoices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"INV_0001"},"sme":{"type":"string","example":"Acme Components Ltd"},"smeAddress":{"type":"string","nullable":true},"debtor":{"type":"string","example":"Globex Retail"},"amount":{"type":"number","example":25000},"currency":{"type":"string","example":"USDC"},"fundedAmount":{"type":"number","example":0},"yieldBps":{"type":"integer","example":800},"dueDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["open","funded","settled","cancelled"]},"onChain":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"}}}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"post":{"tags":["Invoices"],"summary":"Submit an invoice for financing","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sme","debtor","amount","dueDate"],"properties":{"sme":{"type":"string"},"debtor":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string","default":"USDC"},"yieldBps":{"type":"integer","default":800},"dueDate":{"type":"string","format":"date"},"smeAddress":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"INV_0001"},"sme":{"type":"string","example":"Acme Components Ltd"},"smeAddress":{"type":"string","nullable":true},"debtor":{"type":"string","example":"Globex Retail"},"amount":{"type":"number","example":25000},"currency":{"type":"string","example":"USDC"},"fundedAmount":{"type":"number","example":0},"yieldBps":{"type":"integer","example":800},"dueDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["open","funded","settled","cancelled"]},"onChain":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/invoices/{id}":{"get":{"tags":["Invoices"],"summary":"Get an invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invoice","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"INV_0001"},"sme":{"type":"string","example":"Acme Components Ltd"},"smeAddress":{"type":"string","nullable":true},"debtor":{"type":"string","example":"Globex Retail"},"amount":{"type":"number","example":25000},"currency":{"type":"string","example":"USDC"},"fundedAmount":{"type":"number","example":0},"yieldBps":{"type":"integer","example":800},"dueDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["open","funded","settled","cancelled"]},"onChain":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/invoices/{id}/fund":{"post":{"tags":["Invoices"],"summary":"Record an investor contribution (demo, off-chain)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number"}}}}}},"responses":{"200":{"description":"Updated invoice"},"400":{"description":"Invalid amount"},"404":{"description":"Not found"},"409":{"description":"Invoice not open"}}}},"/api/escrow":{"get":{"tags":["Escrow"],"summary":"Deployed escrow contract metadata","responses":{"200":{"description":"Contract info"}}}},"/api/escrow/live":{"get":{"tags":["Escrow"],"summary":"Live escrow state read from Soroban RPC (falls back to deploy snapshot)","responses":{"200":{"description":"Escrow state"}}}}}}