PRD: Invoice Export for Finance Teams
Status: Draft v0.1 | Date: 2026-10-05
Items marked TBD or Assumption were not in your discovery answers. Please confirm or correct them.
1. Executive Summary
Problem Statement
Finance managers using our invoicing app can't export invoices to send to their accountants. This generates about 40 support tickets a month and forces manual workarounds.
Proposed Solution
Add a self-serve export to the web app. Users filter invoices, export them in accountant-friendly formats, and share the result with an external accountant without needing an account.
Success Criteria
| # | KPI | Target | Window |
|---|---|---|---|
| 1 | Export-related support tickets | Down 70%, from about 40/month to 12 or fewer/month | 90 days after launch |
| 2 | Active accounts that have run at least one export | 30% | 60 days after launch |
| 3 | Export success rate (completed / started) | 99% or higher | Ongoing from launch |
| 4 | Export completion time, p95, for up to 5,000 invoices | 30s or less | At launch |
- TBD: the definition of "active account". Suggestion: at least one invoice created or sent in the last 30 days.
- TBD: the ticket baseline. Confirm the 40/month figure comes from a tagged category, so the 70% reduction can be measured.
2. User Experience & Functionality
User Personas
- Finance Manager (primary): Works inside the app and owns invoicing. Needs to hand clean data to the accountant at month-end, quarter-end and year-end.
- External Accountant (secondary): Doesn't use the app. Needs a file they can import into their own tools, or one they can open directly.
User Stories and Acceptance Criteria
US-1. As a finance manager, I want to export invoices for a date range so that I can send them to my accountant.
- An "Export" action is available on the invoice list.
- The user can choose a date range and the export covers all matching invoices.
- The export includes at least these fields: invoice number, customer, issue date, due date, status, currency, subtotal, tax, total, amount paid, and line items. Assumption: the final field list is TBD with Finance.
- Export of 5,000 invoices or fewer completes in 30s or less at p95.
- Exports are limited to the requesting user's own account data. A cross-tenant test must confirm this.
US-2. As a finance manager, I want to filter what gets exported (status, customer, date) so that I send only what the accountant needs.
- The export respects the filters currently applied on the invoice list.
- The confirmation step shows the number of invoices to be exported before the user proceeds.
- An empty result shows a message and doesn't produce an empty file.
US-3. As a finance manager, I want to choose the file format so that it works with my accountant's tools.
- MVP formats (Assumption): CSV and PDF bundle (ZIP of invoice PDFs). TBD: confirm formats with 5 to 10 of the ticket requesters. Accounting-software formats such as QuickBooks or Xero are not in MVP.
- CSV is UTF-8 with a header row. Amounts use a fixed decimal format with an explicit currency column. It opens correctly in Excel and Google Sheets, including non-ASCII customer names.
- Every exported invoice PDF matches what the customer received.
US-4. As a finance manager, I want large exports to run in the background so that the app doesn't hang.
- Exports over 500 invoices (TBD threshold) run asynchronously.
- The user sees progress, and a download link appears in the app when the export is ready.
- A failed export shows a clear error and a retry option, and creates no partial download.
- Export files are available for 7 days (TBD), then deleted.
US-5. As a finance manager, I want to share an export with my accountant so that they don't need an account.
- The user can generate an expiring download link (default 7 days, revocable).
- The link requires no login but contains an unguessable token of at least 128 bits.
- The user can see and revoke active links.
- Each download via the link is logged with a timestamp.
US-6. As a finance manager, I want to see my past exports so that I can re-download without re-running them.
- An export history list shows date, filters, format, status and creator.
- Entries stay visible after the file expires, marked "Expired", with a "Re-run" action.
US-7. As an external accountant, I want a consistent, complete file so that I can reconcile without asking follow-up questions.
- Column names and order are identical across exports.
- Totals in the CSV reconcile to the sum of line items. This is checked by an automated test on a fixture set.
Non-Goals
- No AI features (per constraint).
- No direct integrations with accounting software (QuickBooks, Xero, etc.) or an accountant API.
- No accountant accounts or roles in MVP. Access is via expiring link only.
- No scheduled or recurring exports in MVP.
- No export of data other than invoices (customers, payments, reports).
- No custom column builder or templates.
- No native mobile experience beyond the responsive web UI.
3. AI System Requirements
Not applicable. This feature has no AI components.
4. Technical Specifications
Architecture Overview
Stack: Next.js web app, Postgres. Anything beyond that is TBD, including hosting, queue, and file storage.
Data flow
- The user selects filters and format in the UI, which calls an export API route.
- The API validates the request, checks authorization and tenant scope, and inserts a row into an
exportstable (statusqueued). - A background worker picks up the job, streams invoices from Postgres in batches (cursor-based, to bound memory), and writes the CSV or ZIP to object storage.
- The worker updates the row to
completeorfailed. The UI polls the status endpoint. - Download goes through an authenticated endpoint, or through a tokenized share link that resolves to a short-lived signed URL.
Components
exportstable: id, account_id, created_by, filters (JSONB), format, status, row_count, file_key, error, expires_at, created_at.export_share_linkstable: id, export_id, token_hash, expires_at, revoked_at, last_downloaded_at.- Worker: TBD on the mechanism. Options are a Postgres-backed job queue (for example
pg-boss) or the existing job system, if there is one. A Postgres-backed queue fits a two-engineer team with no new infrastructure. - Object storage for generated files: TBD on provider.
Integration Points
- Postgres: read from invoices and line-item tables, with indexes supporting account + date + status filters. Verify query plans against a realistic dataset.
- Auth: reuse existing session auth and role checks. TBD: which roles may export. Suggestion: finance manager and admin.
- PDF rendering: reuse the existing invoice PDF generator if one exists. TBD: confirm.
- Support tooling: the ticket category or tag for export requests must exist so KPI 1 can be measured.
- Analytics: events for
export_started,export_completed,export_failed,share_link_createdandshare_link_downloaded.
Security & Privacy
- Enforce tenant isolation on every query with
account_idscoping, and cover it with automated tests. - Share-link tokens are random, stored hashed, expiring and revocable. Files are served via signed URLs with short TTLs. Files are encrypted at rest.
- Invoices contain customer PII and financial data. Exports and downloads are audit-logged (who, when, which filters, which IP).
- Mitigate CSV formula injection: prefix cells starting with
=,+,-or@with a single quote. - Rate-limit export creation (TBD limit) to protect the database.
- TBD: compliance requirements (GDPR, SOC 2, regional tax-retention rules) and data residency for stored files. Legal or security review is needed before launch.
5. Risks & Roadmap
Phased Rollout
Plan assumes two engineers over 6 weeks.
MVP (weeks 1 to 4)
- CSV export with filters, synchronous for small sets and async for large ones.
- Export history and authenticated download.
- Analytics events and the ticket tag.
v1.1 (weeks 5 to 6, launch)
- PDF ZIP bundle.
- Expiring share links for accountants, with revoke and audit logging.
- Internal beta with 5 to 10 accounts from recent tickets, then staged rollout behind a feature flag.
- Support macro and help-center article.
v2.0 (post-launch, unscheduled)
- Accounting-software formats and integrations.
- Scheduled and recurring exports.
- Accountant accounts and roles.
- Export of payments and customers.
Rough week plan: week 1 covers spec lock, field and format confirmation, schema and queue. Weeks 2 to 3 cover the CSV pipeline and UI. Week 4 covers history and download. Week 5 covers PDF bundle and share links. Week 6 covers hardening, beta and rollout.
Technical Risks
| Risk | Impact | Mitigation |
|---|---|---|
| Formats and fields don't match what accountants need | Tickets don't drop; KPI 1 missed | Review ticket content and test a sample CSV with 3 to 5 accountants in week 1 |
| Large exports slow down the shared Postgres | Degraded app performance | Cursor batching, read replica if available (TBD), rate limits, load test at 50k invoices |
| PDF bundle generation is slow or memory-heavy | Timeouts, failed jobs | Stream into the ZIP, cap invoices per bundle (TBD), move to v1.1 or cut if behind schedule |
| Share links leak sensitive data | Security incident | Hashed tokens, short expiry, revocation, audit log, security review |
| Scope creep on formats or integrations | Missed 6-week deadline | Non-goals above. Share links and PDF are the first cuts if schedule slips |
| Unclear "active account" or ticket baseline | KPIs can't be measured | Define both before launch and instrument from day one |
| Worker infrastructure is unfamiliar to the team | Delays | Choose a Postgres-backed queue and prototype it in week 1 |
Open Questions
- Which export formats do accountants actually request in the tickets: CSV, PDF, or something else?
- How is "active account" defined?
- Is there an existing background-job system and PDF generator to reuse?
- Which roles may export, and are there compliance or retention requirements?
- Is the share-link flow essential for MVP, or acceptable at v1.1 as scheduled?
I'd like your feedback on three sections in particular: the format and field assumptions in US-1 and US-3, the share-link scope in US-5, and the week plan. Would you like me to save this to a file such as docs/prd-invoice-export.md once you've settled those?
Real run in an isolated folder with only this skill installed. Only the Skill and Read tools were enabled, so nothing was fetched from the web and no file was written. The example is fictional. The discovery answers were supplied in the request; the skill otherwise asks clarifying questions first.
하는 일
소프트웨어 기능과 AI 기능을 위한 구조화된 PRD를 만듭니다. 먼저 요구사항 인터뷰를 하도록 강조한 뒤 엄격한 구조로 작성합니다. 요약(문제, 해결책, 측정 가능한 성공 기준 3~5개), 사용자 경험과 기능(페르소나, 사용자 스토리, 인수 기준, 비목표), 해당되는 경우 AI 시스템 요구사항(도구, 평가 방법), 기술 명세(아키텍처, 연동 지점, 보안·개인정보), 위험과 단계별 출시 계획입니다. '빠르다', '쉽다'가 아니라 구체적이고 테스트할 수 있는 표현을 요구합니다.
동작 방식
- 모델이 핵심 문제, 성공 지표, 제약 조건을 인터뷰하며, 쓰기 전에 최소 두 가지 확인 질문을 합니다.
- 사용자 흐름, 의존성, 비목표를 정리합니다.
- 문서 초안을 쓰고, 지정하지 않은 내용은 TBD 또는 가정으로 표시하며, 특정 섹션에 대한 피드백을 요청합니다.
이런 때 좋습니다
새 기능 시작, 막연한 아이디어를 명세로 바꾸기, 이해관계자에게 하나의 기준 문서 제공.
지침만 담긴 패키지입니다. 스크립트가 없고 네트워크 접속, 파일 쓰기, 계정이 필요 없습니다. 스킬은 먼저 확인 질문을 하고 지정되지 않은 제약 조건은 지어내지 말고 TBD로 표시하라고 하지만, 초안에는 여전히 가정이 들어갈 수 있으니 공유하기 전에 모든 요구사항, 지표, 기술 선택을 검토하세요. 스스로 아무것도 저장하지 않으므로 파일이 필요하면 저장 위치를 알려 주세요.