Download statement CSV
download_statement_csvDownload statement line items as CSV using an invoice number for a single statement or a start/end date range. Optionally save to an absolute path.
Instructions
Download statement line items as CSV. Pass invoice_number for a single statement, OR a start_date/end_date range to export across statements. If save_to_path (an absolute path whose parent directory exists) is given, the CSV is written there — an existing file is never overwritten (returns FILE_EXISTS) — and the tool returns the byte count. Otherwise the CSV is returned inline, truncated at 100KB (with truncated: true) — use save_to_path for large exports.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | Export range end, YYYY-MM-DD. | |
| start_date | No | Export range start, YYYY-MM-DD. | |
| save_to_path | No | Absolute path (existing parent dir) to write the CSV to instead of returning it inline. | |
| invoice_number | No | Single-statement invoice number. |