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

# Invoices

> Manage invoices and AI-powered scanning upload

## Description

**Invoices** represent supply documents (electricity, heat, fuels, waste, etc.). They can be created manually or uploaded with automatic scanning.

## Endpoints

| Method | Path                              | Description              |
| ------ | --------------------------------- | ------------------------ |
| GET    | `/api/v1/invoices`                | List invoices            |
| GET    | `/api/v1/invoices/{id}`           | Get invoice              |
| POST   | `/api/v1/invoices`                | Create or update invoice |
| POST   | `/api/v1/invoices/upload-invoice` | Upload and scan invoice  |
| DELETE | `/api/v1/invoices/{id}`           | Delete invoice           |
| GET    | `/api/v1/invoices/dashboard`      | Invoice dashboard        |

## Invoice types

* `heat`, `fuel`, `electricity`, `generated-energy`
* `process-emissions`, `water`, `wastes`, `wastes-expenses`, `others`, `waste-water`

## Upload with scanning

`POST /api/v1/invoices/upload-invoice` lets you send a file and the AI extracts the data. Requires `companyId` and file in `multipart/form-data`.

## Required fields (manual creation)

* `id`, `type`, `companyId`, `totalCost`, `currency`
* `startDate`, `endDate`
* For `type=waste`: `wasteType`, `wasteDisposalMethod`
