{"openapi":"3.1.0","info":{"title":"POST /api/v1/journal-entries/bulk-upload/preview","version":"1.0.0","description":"Preview bulk journal entry upload"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/journal-entries/bulk-upload/preview":{"post":{"tags":["journal-entries"],"summary":"Preview bulk journal entry upload","description":"Parse and validate a CSV/Excel file of journal entries without creating anything. Returns a structured preview with per-entry validation.","operationId":"preview_bulk_je_upload_api_v1_journal_entries_bulk_upload_preview_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/BulkJournalEntryUploadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PreviewBulkJeUploadResponse_"}}}},"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"}}}},"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":{"BulkJePreviewEntry":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"entry_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entry Date"},"line_entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Line Entries","default":[]},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"additionalProperties":true,"type":"object","title":"BulkJePreviewEntry"},"BulkJournalEntryUploadRequest":{"properties":{"s3_key":{"type":"string","minLength":1,"title":"S3 Key","description":"S3 key of the uploaded CSV/Excel file (from POST /upload/direct)"}},"type":"object","required":["s3_key"],"title":"BulkJournalEntryUploadRequest","description":"Request schema for bulk journal entry upload (preview and post)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PreviewBulkJeUploadResponse":{"properties":{"total_entries":{"type":"integer","title":"Total Entries"},"total_line_items":{"type":"integer","title":"Total Line Items"},"total_errors":{"type":"integer","title":"Total Errors"},"entries":{"items":{"anyOf":[{"$ref":"#/components/schemas/BulkJePreviewEntry"},{"additionalProperties":true,"type":"object"}]},"type":"array","title":"Entries"},"errors":{"items":{"anyOf":[{"additionalProperties":true,"type":"object"},{"$ref":"#/components/schemas/BulkJePreviewEntry"}]},"type":"array","title":"Errors"},"is_valid":{"type":"boolean","title":"Is Valid"}},"additionalProperties":true,"type":"object","required":["total_entries","total_line_items","total_errors","entries","errors","is_valid"],"title":"PreviewBulkJeUploadResponse","description":"Response for ``preview_bulk_je_upload``."},"SuccessEnvelope_PreviewBulkJeUploadResponse_":{"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/PreviewBulkJeUploadResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PreviewBulkJeUploadResponse]"},"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":[]}]}