N
Productivity
Log Invoices & Receipts to Notion Automatically — No Manual Entry
Every receipt you upload gets read and logged to your Notion database in ~3s — merchant, amount, date, and line items, all filled in for you.
Trusted by developers worldwide to automate document workflows.
✓ Free DocuParseAPI account✓ Notion DB✓ n8n/Make/Zapier or code
The guide
1
Set up your Notion database
Create a Notion database with these property types:
Vendor — Title Amount — Number Currency — Text Date — Date Invoice # — Text Tax — Number Payment Method — Text
2
Get your Notion API key
Go to developers.notion.com → New integration → copy the Internal Integration Secret. In Notion, open your database → Share → Invite → select your integration by name.
3
Get your Database ID
Copy the Database ID from your Notion database URL:
notion.so/workspace/[DATABASE-ID]?v=...
^^^^^^^^^^^^^^^^
This is your NOTION_DATABASE_IDNeed your API key first?
20 free documents/month — no credit card
4
Extract the document
POST your receipt or invoice to DocuParseAPI. The response gives you merchant, total, tax, date, currency, and invoice_id.
5
Write to Notion
POST to the Notion API pages endpoint with your database ID and extracted fields:
import os, requests
NOTION_HEADERS = {
"Authorization": f"Bearer {os.environ['NOTION_API_KEY']}",
"Notion-Version": "2022-06-28",
"Content-Type": "application/json",
}
def log_to_notion(inv):
properties = {
"Vendor": {"title": [{"text": {"content": inv.get("merchant","")}}]},
"Amount": {"number": float(inv.get("total") or 0)},
"Tax": {"number": float(inv.get("tax") or 0)},
"Currency": {"rich_text": [{"text": {"content": inv.get("currency","USD")}}]},
"Invoice #": {"rich_text": [{"text": {"content": inv.get("invoice_id","")}}]},
}
if inv.get("date"):
properties["Date"] = {"date": {"start": inv["date"]}}
r = requests.post("https://api.notion.com/v1/pages",
headers=NOTION_HEADERS,
json={"parent": {"database_id": os.environ['NOTION_DATABASE_ID']},
"properties": properties})
r.raise_for_status()
return r.json()Full working example
python
import os, requests
DOCUPARSE_KEY = os.environ["DOCUPARSE_API_KEY"]
NOTION_TOKEN = os.environ["NOTION_API_KEY"]
NOTION_DB_ID = os.environ["NOTION_DATABASE_ID"]
NOTION_HEADERS = {
"Authorization": f"Bearer {NOTION_TOKEN}",
"Notion-Version": "2022-06-28",
"Content-Type": "application/json",
}
def extract_document(path):
with open(path, "rb") as f:
r = requests.post("https://docuparseapi.com/api/v1/extract",
headers={"Authorization": f"Bearer {DOCUPARSE_KEY}"},
files={"file": f}, timeout=30)
data = r.json()
if not data["success"]: raise RuntimeError(data["error"]["code"])
return data
def log_to_notion(inv):
props = {
"Vendor": {"title": [{"text": {"content": inv.get("merchant") or "Unknown"}}]},
"Amount": {"number": float(inv.get("total") or 0)},
"Tax": {"number": float(inv.get("tax") or 0)},
"Currency": {"rich_text": [{"text": {"content": inv.get("currency","USD")}}]},
"Invoice #": {"rich_text": [{"text": {"content": inv.get("invoice_id","")}}]},
"Payment Method": {"rich_text": [{"text": {"content": inv.get("payment_method","")}}]},
}
if inv.get("date"):
props["Date"] = {"date": {"start": inv["date"]}}
r = requests.post("https://api.notion.com/v1/pages",
headers=NOTION_HEADERS,
json={"parent": {"database_id": NOTION_DB_ID}, "properties": props})
r.raise_for_status()
return r.json()
def process(file_path):
inv = extract_document(file_path)
page = log_to_notion(inv)
print(f"Logged: {inv.get('merchant')} — {inv.get('total')} | {page['url']}")
process("receipt.pdf")What gets extracted
Common errors and fixes
Ready to start?
20 documents free every month. No credit card. Set up in 5 minutes.
Get Your Free API Key