{"openapi":"3.1.0","info":{"title":"GET /api/v1/invoices/suggestions","version":"1.0.0","description":"List payment suggestions"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/invoices/suggestions":{"get":{"tags":["invoices"],"summary":"List payment suggestions","description":"List auto-detected payment match suggestions for the business.","operationId":"list_suggestions_api_v1_invoices_suggestions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: pending, accepted, rejected, expired","default":"pending","title":"Status"},"description":"Filter by status: pending, accepted, rejected, expired"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Minimum confidence","title":"Min Confidence"},"description":"Minimum confidence"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max results","default":100,"title":"Limit"},"description":"Max results"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ListSuggestionsResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoicePaymentSuggestionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Suggestion UUID."},"invoice_id":{"type":"string","title":"Invoice Id","description":"UUID of the matched invoice."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the matched transaction."},"transaction_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Transaction Date","description":"Date of the matched bank transaction."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"amount":{"type":"integer","title":"Amount","description":"Suggested allocation in cents."},"confidence":{"type":"number","title":"Confidence","description":"Composite match confidence (0.0–1.0)."},"signals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Signals","description":"Breakdown of individual signal scores (amount_match, date_proximity, memo_match, counterparty_match)."},"match_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Group Id","description":"Groups multi-invoice suggestions sharing the same transaction."},"status":{"type":"string","title":"Status","description":"Suggestion status: pending, accepted, rejected, expired."},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At","description":"When the suggestion was accepted or rejected."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."}},"type":"object","required":["id","invoice_id","transaction_id","business_id","amount","confidence","status","created_at","updated_at"],"title":"InvoicePaymentSuggestionResponse","description":"Response schema for an auto-detected payment match suggestion.\n\nRepresents a candidate match between a bank transaction and an invoice,\nproduced by the matching engine (Phase 2).","example":{"amount":12000,"business_id":"019ab37c-bus1-7000-8000-000000000001","confidence":0.87,"created_at":"2026-02-13T12:00:00Z","id":"019ab37c-sug1-7000-8000-000000000001","invoice_id":"019ab37c-inv1-7000-8000-000000000001","signals":{"amount_match":0.4,"counterparty_match":0.04,"date_proximity":0.18,"memo_match":0.25},"status":"pending","transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2026-02-13T12:00:00Z"}},"ListSuggestionsResponse":{"items":{"$ref":"#/components/schemas/InvoicePaymentSuggestionResponse"},"type":"array","title":"ListSuggestionsResponse","description":"Response for ``list_suggestions`` — bare array."},"SuccessEnvelope_ListSuggestionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ListSuggestionsResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ListSuggestionsResponse]"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}