---
title: "Export Spending"
method: POST
path: "/api/exports/spending"
tags: ["Exports"]
---

# Export Spending

`POST /api/exports/spending`

## Request

- Base URL: `https://api.earmarkiq.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.earmarkiq.app/api/exports/spending`
- Auth: HTTP bearer

Generate spending export (CSV or PDF).

## Request body

- SpendingExportRequest
  - `period` string, required
  - `format` string
  - `merchant` string, nullable

## Response `200`

Successful Response

- ExportResponse
  - `export_id` string, required
  - `download_url` string, required
  - `filename` string, required
  - `format` string, required
  - `file_size` integer, required
  - `ai_generated` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/earmarkiq/apis/earmark-api.md) · [All operations](https://skmtc.dev/earmarkiq/apis/earmark-api/llms.txt) · [OpenAPI document](https://skmtc.dev/earmarkiq/apis/earmark-api/revisions/4a2c41907105?raw)
