Integrationsn8n
n8n
Automation

Invoice Parsing in n8n — Automate Receipt & Invoice Extraction (No Code)

If invoices arrive in your inbox and you're still typing the data out manually, this workflow eliminates that entirely.

Trusted by developers worldwide to automate document workflows.

Get Your Free API KeyView API Docs
Free DocuParseAPI accountn8n accountA destination app

The guide

1
Get your API key
Sign up at docuparseapi.com/signup. Go to Dashboard → API Keys → Create new key. Copy it — starts with dex_.
2
Create a new workflow
In n8n click New Workflow. Add a trigger: Gmail Trigger → New Attachment for email invoices, or Manual Trigger for testing.
3
Add an HTTP Request node
After the trigger, add an HTTP Request node. Configure it exactly as shown below:
Method: POST
URL: https://docuparseapi.com/api/v1/extract
Authentication: Header Auth
Header Name: Authorization
Header Value: Bearer YOUR_API_KEY
Body Content Type: Multipart/Form-Data
Body Parameter Name: file
Body Parameter Value: {{ $binary.data }}
Body Parameter Type: File/Binary
Need your API key first?
20 free documents/month — no credit card
Get Free API Key →
4
Map the fields
Add a Set node after HTTP Request. Map these fields:
merchant  →  {{ $json.merchant }}
total     →  {{ $json.total }}
tax       →  {{ $json.tax }}
currency  →  {{ $json.currency }}
date      →  {{ $json.date }}
invoice_id → {{ $json.invoice_id }}
5
Send to your destination
Add Google Sheets → Append Row. Map the Set node fields to your sheet columns. Done — every invoice creates a new row automatically. Add an IF node after HTTP Request to handle errors: condition {{ $json.success }} equals true, false path sends a Slack notification with {{ $json.error.code }}.

Full working example

json
{
  "name": "Invoice Parser — DocuParseAPI",
  "nodes": [
    { "name": "Manual Trigger", "type": "n8n-nodes-base.manualTrigger", "position": [250, 300] },
    { "name": "Extract Invoice", "type": "n8n-nodes-base.httpRequest", "position": [460, 300],
      "parameters": {
        "method": "POST",
        "url": "https://docuparseapi.com/api/v1/extract",
        "authentication": "headerAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": { "parameters": [{
          "name": "file",
          "value": "={{ $binary.data }}",
          "parameterType": "formBinaryData"
        }] }
      }
    },
    { "name": "Map Fields", "type": "n8n-nodes-base.set", "position": [680, 300],
      "parameters": { "values": { "string": [
        { "name": "merchant", "value": "={{ $json.merchant }}" },
        { "name": "total", "value": "={{ $json.total }}" },
        { "name": "currency", "value": "={{ $json.currency }}" },
        { "name": "date", "value": "={{ $json.date }}" }
      ] } }
    }
  ]
}

What gets extracted

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, unit_price, total

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, or PNG only
FILE_TOO_LARGE_AUTHENTICATEDFile exceeds 10 MBCompress the file before sending
EXTRACTION_FAILEDDocument could not be parsedTry a cleaner scan or different file

Ready to start?

20 documents free every month. No credit card. Set up in 5 minutes.

Get Your Free API Key