Productivity

Log Invoices & Receipts to Notion Automatically — No Manual Entry

Every receipt you upload gets read and logged to your Notion database — merchant, amount, date, and line items, all filled in for you.

By Othmane M., founder of DocuParse API · Last reviewed: 2026-10-20

The guide

  1. 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
    Receipt        — Files & media
  2. 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. 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_ID
    Need your API key first?
    20 free documents/month — no credit card
    Sign up — get a free API key
  4. 4

    Extract the document

    Submit your receipt or invoice and fetch the result (see the Python guide). The fetched data gives you merchant, total, tax, date, currency and invoice_id.

  5. 5

    Write to Notion

    POST to the Notion API pages endpoint with your database ID and extracted fields. Store a link to the original receipt (for example its Google Drive URL) in a Files & media property so it sits next to the extracted data.

    import os, requests
    
    NOTION_DB_ID = os.environ["NOTION_DATABASE_ID"]
    NOTION_HEADERS = {
        "Authorization": f"Bearer {os.environ['NOTION_API_KEY']}",
        "Notion-Version": "2022-06-28",
        "Content-Type": "application/json",
    }
    
    def log_to_notion(inv, file_url=None):
        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") or "USD"}}]},
            "Invoice #": {"rich_text": [{"text": {"content": inv.get("invoice_id") or ""}}]},
            "Payment Method": {"rich_text": [{"text": {"content": inv.get("payment_method") or ""}}]},
        }
        if inv.get("date"):
            props["Date"] = {"date": {"start": inv["date"]}}
        if file_url:
            props["Receipt"] = {"files": [{"name": "receipt", "type": "external", "external": {"url": file_url}}]}
        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()

Full working example

python
import os, time, requests

NOTION_DB_ID = os.environ["NOTION_DATABASE_ID"]
NOTION_HEADERS = {
    "Authorization": f"Bearer {os.environ['NOTION_API_KEY']}",
    "Notion-Version": "2022-06-28",
    "Content-Type": "application/json",
}

API = "https://docuparseapi.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['DOCUPARSE_API_KEY']}"}

def parse_document(path: str) -> dict:
    # 1. Submit
    with open(path, "rb") as f:
        submit = requests.post(f"{API}/extract", headers=HEADERS,
                               files={"file": (os.path.basename(path), f)}, timeout=30).json()
    if not submit.get("success"):
        raise RuntimeError(f"[{submit['error']['code']}] {submit['error']['message']}")

    # 2. Fetch the result
    for _ in range(40):
        doc = requests.get(f"{API}/documents/{submit['document_id']}",
                           headers=HEADERS, timeout=30).json()
        if doc["status"] == "completed":
            return doc["data"]
        if doc["status"] == "failed":
            raise RuntimeError(f"Extraction failed: {submit['document_id']}")
        time.sleep(1.5)
    raise TimeoutError(submit["document_id"])

def log_to_notion(inv, file_url=None):
    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") or "USD"}}]},
        "Invoice #": {"rich_text": [{"text": {"content": inv.get("invoice_id") or ""}}]},
        "Payment Method": {"rich_text": [{"text": {"content": inv.get("payment_method") or ""}}]},
    }
    if inv.get("date"):
        props["Date"] = {"date": {"start": inv["date"]}}
    if file_url:
        props["Receipt"] = {"files": [{"name": "receipt", "type": "external", "external": {"url": file_url}}]}
    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, file_url=None):
    inv = parse_document(file_path)
    page = log_to_notion(inv, file_url)
    print(f"Logged: {inv.get('merchant')} — {inv.get('total')} | {page['url']}")

process("receipt.pdf")

What gets extracted

FieldDescription
merchantThe vendor or store name
totalThe final charged amount including tax
subtotalThe pre-tax amount
taxThe tax amount charged
dateInvoice or transaction date (ISO 8601)
due_datePayment due date, or null if not present
invoice_idInvoice number or receipt ID from the document
currencyISO 4217 currency code (USD, EUR, GBP, etc.)
payment_methodCard type, cash, or other payment method
line_itemsArray of items with description, quantity, price, line_total, vat_rate

Common errors and fixes

MISSING_API_KEYAuthorization header missingAdd header: Authorization: Bearer YOUR_KEY
INVALID_API_KEYKey not recognisedCheck key in dashboard — regenerate if needed
LIMIT_EXCEEDEDMonthly document limit reachedUpgrade at docuparseapi.com/pricing
UNSUPPORTED_FILE_TYPEFile format not supportedUse PDF, JPG, PNG or CSV
FILE_TOO_LARGE_AUTHENTICATEDThe file is too largeCompress the image or split the PDF
TOO_MANY_PAGESMore than 20 pagesSplit the PDF into parts of up to 20 pages
EXTRACTION_FAILEDDocument could not be parsedTry a cleaner scan or different file

Ready to start?

20 documents a month free, with full API access. No credit card. Webhooks on Starter and Pro.

Sign up — get a free API key