{"openapi":"3.1.0","info":{"title":"GET /api/v1/transactions/{transaction_id}/suggested-matches","version":"1.0.0","description":"Suggested matches for a transaction"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/transactions/{transaction_id}/suggested-matches":{"get":{"tags":["transactions"],"summary":"Suggested matches for a transaction","description":"Return ranked suggested matches for a single bank transaction. Income transactions are matched against open invoices; expense transactions against open bills. Matches are scored by amount, date proximity, memo, and counterparty similarity.","operationId":"get_transaction_suggested_matches_api_v1_transactions__transaction_id__suggested_matches_get","parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","title":"Transaction Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max suggested matches","default":10,"title":"Limit"},"description":"Max suggested matches"},{"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/TransactionSuggestedMatchesResponse"}}}},"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"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"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"},"SuggestedMatch":{"properties":{"type":{"type":"string","enum":["invoice","bill"],"title":"Type","description":"Whether this match is an invoice (income) or a bill (expense)."},"id":{"type":"string","title":"Id","description":"UUID of the matched invoice or bill."},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Invoice number or vendor bill number, if set."},"party_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Party Name","description":"Customer name (invoice) or vendor name (bill)."},"balance_due":{"type":"integer","title":"Balance Due","description":"Open balance of the invoice/bill in cents."},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date","description":"Due date of the invoice/bill (ISO 8601 date)."},"suggested_amount":{"type":"integer","title":"Suggested Amount","description":"Suggested allocation amount in cents (capped at the open balance)."},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Composite match confidence score (0-1)."},"signals":{"additionalProperties":true,"type":"object","title":"Signals","description":"Per-signal score breakdown (amount, date, memo, counterparty)."},"match_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Group Id","description":"Set when this match is part of a multi-document group (one transaction paying several invoices/bills)."}},"type":"object","required":["type","id","balance_due","suggested_amount","confidence"],"title":"SuggestedMatch","description":"A single suggested invoice or bill match for a bank transaction."},"TransactionSuggestedMatchesResponse":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the transaction."},"amount":{"type":"integer","title":"Amount","description":"Absolute transaction amount in cents."},"direction":{"type":"string","enum":["inflow","outflow"],"title":"Direction","description":"`inflow` (money in → invoices) or `outflow` (money out → bills)."},"matches":{"items":{"$ref":"#/components/schemas/SuggestedMatch"},"type":"array","title":"Matches","description":"Suggested matches ranked by confidence (highest first)."}},"type":"object","required":["transaction_id","amount","direction"],"title":"TransactionSuggestedMatchesResponse","description":"Suggested matches for a single transaction."},"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":[]}]}