> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentaos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoices & Exports

> Download invoices, monthly statements, and CSV exports for accounting.

Every confirmed payment generates a tax-compliant invoice with exchange rates, VAT, and buyer info. Export them for your accountant.

```mermaid theme={null}
flowchart LR
    P[Payment] --> I[Invoice]
    I --> PDF[PDF per invoice]
    I --> CSV[CSV export]
    I --> ST[Monthly statement]
```

## List Invoices

```typescript theme={null}
const invoices = await agentaos.invoices.list({
  from: '2026-03-01',
  to: '2026-03-31',
  status: 'issued',     // 'all' | 'issued' | 'voided'
  limit: 50,
});
```

## Download Invoice PDF

```typescript theme={null}
import { writeFileSync } from 'fs';

const pdf = await agentaos.invoices.downloadPdf('invoice-uuid');
writeFileSync('invoice.pdf', pdf);
```

Each PDF includes:

* Merchant and buyer details
* Amount in crypto + fiat equivalent
* Exchange rate with source and timestamp
* Tax breakdown (subtotal, tax amount, total)
* Transaction hash with explorer link

## Download Monthly Statement

Wise-style monthly statement with balance reconciliation, VAT summary, and transaction ledger.

```typescript theme={null}
const statement = await agentaos.invoices.downloadStatement({
  from: '2026-03-01',
  to: '2026-03-31',
});
writeFileSync('march-statement.pdf', statement);
```

The statement includes:

* **Summary**: Total received, total sent, net flow, transaction count
* **Balance reconciliation**: Opening/closing balance from on-chain data
* **Transaction ledger**: Every inbound and outbound payment with direction, amount, tax
* **VAT summary**: Taxable supplies by rate + exempt supplies

## Export CSV

22-column CSV for accounting software (Merit Aktiva, Directo, Xero, etc.):

```typescript theme={null}
const csv = await agentaos.invoices.exportCsv({
  from: '2026-03-01',
  to: '2026-03-31',
});
writeFileSync('invoices.csv', csv);
```

**Columns:** date, direction, invoice\_number, description, crypto\_amount, crypto\_token, token\_address, chain, exchange\_rate, exchange\_rate\_source, exchange\_rate\_at, fiat\_amount, fiat\_currency, tax\_name, tax\_rate, tax\_amount, total\_eur, buyer\_name, buyer\_company, buyer\_country, buyer\_vat, tx\_hash, status

## Void an Invoice

```typescript theme={null}
await agentaos.invoices.void('invoice-uuid');
```

<Warning>
  Voiding an invoice is irreversible. The payment is not refunded, only the accounting record is marked as voided.
</Warning>

## Transactions

List all confirmed payments (inbound received + outbound sent):

```typescript theme={null}
const txs = await agentaos.transactions.list({
  direction: 'inbound',    // 'all' | 'inbound' | 'outbound'
  from: '2026-03-01',
  to: '2026-03-31',
  limit: 50,
});
```
