Skip to content

[FEATURE]: Add CSV/JSON Export for Invoice Data #136

@Atharva0506

Description

@Atharva0506

Problem

Currently, Chainvoice only supports exporting invoices as PDF (via jsPDF + html2canvas). There is no option to export invoice data in machine-readable formats like CSV or JSON.

Businesses using Chainvoice need structured data for:

  • Accounting software integration (QuickBooks, Xero, Wave)
  • Tax filing and audits
  • Data analysis and reconciliation
  • Bookkeeping automation

Manually re-entering data from PDFs defeats the purpose of a decentralized, automated invoicing platform.

Proposed Solution

Add "Export as CSV" and "Export as JSON" buttons alongside the existing PDF download on the Sent Invoices and Received Invoices pages.
JSON Format
Array of invoice objects with all relevant fields.

Implementation Approach

  • Use Blob + URL.createObjectURL() for client-side download (no backend needed)
  • Support exporting all invoices or only selected/filtered ones
  • Place buttons next to the existing PDF download action
  • Only decrypted (already visible) invoice data is exported — no additional Lit Protocol calls needed

Why This Matters

  • Essential for any business-facing invoicing tool
  • No smart contract changes required — purely frontend
  • Complements the existing PDF export, doesn't replace it
  • Low risk, high user value

Additional Context

  • The existing PDF generation lives in frontend/src/utils/generateInvoicePDF.js
  • Invoice data is already decrypted and available in component state on the Sent/Received pages
  • Could follow a similar utility pattern: generateInvoiceCSV.js / generateInvoiceJSON.js

Additional Context

No response

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions