# Upload Documents to Chat

Upload photos or PDFs of receipts, invoices, and invoices. The assistant automatically extracts data with OCR.

## Supported Formats

| Format | Max size | Use cases |
|---------|-----------|--------------|
| **PDF** | 25 MB | Invoices, quotes, payrolls |
| **JPG** | 10 MB | Photos of receipts, tickets |
| **PNG** | 10 MB | Screenshots, scanned documents |

## How to Upload a Document

### From the Chat

1. Click the **paperclip icon** (📎) in the input bar
2. Select your file (PDF, JPG, PNG)
3. The assistant processes the image
4. It shows you the extracted data

### Option: Drag and Drop

Drag your file directly to the chat:

1. Open the assistant's chat
2. Drag the image or PDF from your folder
3. Drop it into the chat window
4. It loads automatically

## What the Assistant Extracts

OCR automatically recognizes:

### From Receipts/Invoices

- **Concept**: what you bought
- **Amount**: how much it cost
- **VAT**: if it's itemized
- **Date**: when
- **Vendor**: from whom you bought it
- **Category**: Material, Services, Travel, etc.

### Example 1: Office Receipt

You upload a photo of the Staples receipt:

> "3 packs of A4 paper - €18.50"

The assistant:
- Extracts concept: "A4 Paper"
- Quantity: 3
- Amount: €18.50
- Category: Office supplies
- Date: Feb 8, 2025

It asks you: **"Should I create an expense?"**

### Example 2: Invoice from a Vendor

You upload an invoice you received from your vendor:

**Invoice:**
```
Electricidad - Febrero 2025
Total: €145,30 + 21% IVA = €175,81
```

The assistant:
- Detects: Service expense (electricity)
- Amount: €175.81 (with VAT)
- Category: Services
- Date: February 2025

### Example 3: Client Invoice

You upload a PDF invoice that you issued and the client paid:

The assistant:
- Extracts invoice data
- Document number
- Concept and amount
- Suggests marking it as "Paid"

## Flow After Upload

1. **The assistant processes** the document (1-3 seconds)
2. **Shows the extracted data** in editable format
3. **Questions**: "Should I create an expense of €45.00 for Material?"
4. **You confirm or correct** the data
5. **It is automatically created** in Frihet

If something is not accurate, **edit directly before confirming**:

- Change concept
- Adjust amount
- Change date
- Reassign category

## Special Cases

### Invoice with Multiple Lines

If you upload an invoice with 5 different concepts:

The assistant:
- Extracts each line
- Asks if you want to create one expense with the total
- Or if you want to create 5 separate expenses (if they are different categories)

Recommendation: **Respond naturally**
- "Create a single expense with everything" → €185.30 total
- "Separate Material and Services" → 2 expenses

### Receipt with Unclear Data

If the photo is blurry or tilted:

- The assistant attempts to extract anyway
- Marks doubtful data as **"Requires review"**
- Allows you to edit them manually

### Document in English or Different Language

The assistant understands:

- Spanish ✅
- English ✅
- French ✅
- German ✅
- Portuguese ✅

If it's in another language, it translates it automatically.

### Incomplete Document

If critical information is missing (date or amount):

The assistant asks you:
- "When was this expense?" → You enter the date
- "What is the total amount?" → You edit the amount

## Tips for Better Extractions

### Quality Photos

✅ **Good lighting** — no shadows
✅ **Complete document** — everything fits in the photo
✅ **Right angle** — avoid tilted photos
✅ **Decent resolution** — not pixelated

❌ Very dark photo
❌ Cropped document
❌ Very tilted photo
❌ Blurry photo

### Information Order

If possible:
- Make the **concept visible**
- Ensure the **amount is clear**
- Include the **date**
- Show the **vendor/company**

### Cases Where OCR Fails

**Cash register tickets:**
- Very small letters
- Degraded thermal paper
- Intertwined numbers

**Solution:** Edit manually afterward. The assistant will allow you to.

## Creating Expenses vs Invoices

The assistant automatically suggests:

| Type | When |
|------|--------|
| **Expense** | It's a receipt for something you bought |
| **Invoice** | It's a document you issued to a client |
| **Received invoice** | It's an invoice from a vendor |

If it's not sure, it **asks:**
- "Is it an expense or an invoice?"
- You answer and it processes correctly

## Document Privacy

- Documents are processed with local OCR
- They are not saved on third-party servers
- The extracted data is saved in your Frihet account (encrypted)
- You can delete the original document afterward

From Settings → Privacy you can:
- Delete old uploads
- Disable OCR if you prefer

## Limitations

The assistant **cannot**:

- Process Word or Excel files (only PDF/JPG/PNG)
- Extract from very deteriorated images (< 100px wide)
- Recognize handwriting (manual writing)
- Read QR codes or barcodes

---

**Next section:** [Integrations](../integraciones/stripe)
