# Zap blueprint: Invoice PDFs from email into a sheet

**This is a blueprint, not an import file.** Zapier has no public format for importing Zaps, so you rebuild these steps by hand in the Zap editor. It takes about 10–20 minutes (our estimate).
Create a new Zap: https://zapier.com/app/editor
Full recipe: https://recipeagents.usestarbase.com/recipes/invoice-pdf-to-sheet

## Steps
1. **Trigger:** Gmail: New Attachment
   - Recipe input: Email with PDF attachment
2. **Filter by Zapier** (optional): only continue if the input is the kind you want (see the recipe's failure modes).
3. **Action:** ChatGPT (OpenAI): Conversation, or AI by Zapier
   - Paste this prompt and map the trigger fields into the {{...}} placeholders:

```
Extract from this invoice text: vendor, invoice_number, date (YYYY-MM-DD), currency, net, vat, total. Return JSON; use null for missing fields; never compute values that aren't printed. Text: {{pdf_text}}
```
4. **Action:** Formatter by Zapier → Utilities → Import JSON / or Code by Zapier, to split the JSON fields (if the prompt returns JSON).
5. **Action:** Google Sheets: Create Spreadsheet Row
6. **Test each step** with a real example, then turn the Zap on. Keep a human approval on anything customer-facing.

## Recipe steps (from the page)
- Trigger: new email matching has:attachment filename:pdf invoice.
- Extract text from the PDF.
- AI step returns JSON with the fields.
- Append a row. Look up the invoice number first to skip duplicates.

## Where it breaks
- Scanned PDFs: Image-only PDFs come back with no text, so add an OCR step or flag them.
- Totals that don't add up: Add a sheet formula that checks net + vat = total and highlights mismatches.

App and step names follow Zapier's current app directory as of 2026-10-16. Names change, so search the app in the editor if a step looks different.
