{"openapi":"3.1.0","info":{"title":"POST /api/v1/transactions/suggested-matches/batch","version":"1.0.0","description":"Suggested matches for a batch of transactions"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/transactions/suggested-matches/batch":{"post":{"tags":["transactions"],"summary":"Suggested matches for a batch of transactions","description":"Score a batch of bank transactions against open invoices (for money in) and open bills (for money out) and return ranked suggested matches, QBO-style. Used to render the inline 'N matches found' badge for the visible page of the Transactions list. Results are ephemeral (no suggestion records are persisted).","operationId":"get_bulk_suggested_matches_api_v1_transactions_suggested_matches_batch_post","parameters":[{"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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSuggestedMatchesRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSuggestedMatchesResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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":{"BulkSuggestedMatchesRequest":{"properties":{"transaction_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Transaction Ids","description":"Transaction UUIDs to score (typically the visible page)."}},"type":"object","required":["transaction_ids"],"title":"BulkSuggestedMatchesRequest","description":"Request body for batch suggested-match lookup (Transactions list)."},"BulkSuggestedMatchesResponse":{"properties":{"items":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SuggestedMatch"},"type":"array"},"type":"object","title":"Items","description":"Mapping of transaction UUID → ranked suggested matches. Transactions with no qualifying match are omitted."}},"type":"object","title":"BulkSuggestedMatchesResponse","description":"Suggested matches for a batch of transactions, keyed by transaction ID."},"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."},"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":[]}]}