---
title: "Send supplier invoices straight to your accounting workflow · Polpo Mail"
description: "When an invoice arrives at invoices@, your webhook gets the details and a link to download each PDF with the REST API, ready for bookkeeping or OCR."
url: https://polpomail.com/use-cases/invoice-processing
last_updated: 2026-11-26
---

[Use cases](https://polpomail.com/use-cases)

# Send supplier invoices straight to your accounting workflow

When an invoice arrives at invoices@, your webhook gets the details and a link to download each PDF with the REST API, ready for bookkeeping or OCR.

[Create your free workspace](https://polpomail.com/signup) [How webhooks work](https://polpomail.com/webhooks)

## Why automate it

Suppliers email PDF invoices to an accounts address, and someone downloads them one by one. With a webhook, each new invoice email triggers your workflow, which downloads the attachments and passes them to your accounting software or OCR service.

How it works

## Set it up in three steps

1. 1

   ### Filter the invoices mailbox

   Use To or Cc matches ^(invoices|accounts)@ so only billing mail triggers the workflow.
2. 2

   ### Read the attachment list

   Each attachment comes with its name, type, size and a REST API url. The file content isn't in the webhook, which keeps requests small.
3. 3

   ### Download and process

   Fetch each PDF with an access token that has the read scope, then send it to OCR, your accounting tool or a shared drive.

Settings

## The webhook to create

In Settings › Developer, after you sign in.

|  |  |
| --- | --- |
| Format | JSON |
| From matches | empty (any sender) |
| To or Cc matches | `^(invoices\|accounts)@` |
| Request headers | none needed |
| Extra JSON | `{"workflow": "accounts-payable"}` |

- Invoices go into the workflow as soon as they arrive, not at month end.
- Attachments stay in your mailbox, so you keep the original email for audits.
- The access token for downloads can be limited to read-only.

Example

## Python: download the PDF attachments

Every request includes the webhook's token in `X-Polpo-Webhook-Token`; check it first. See the [payload reference](https://polpomail.com/developers#webhooks).

```
@app.post("/hooks/invoices")
def invoice():
    if not hmac.compare_digest(request.headers.get("X-Polpo-Webhook-Token", ""), TOKEN):
        abort(401)
    m = request.json["message"]
    for a in m["attachments"]:
        if a["content_type"] == "application/pdf":
            pdf = requests.get(a["url"], headers={"Authorization": f"Bearer {READ_TOKEN}"}).content
            accounting.upload(pdf, supplier=m["from"]["address"], subject=m["subject"])
    return "", 204
```

FAQ

## Common questions

**Why aren't attachments included in the webhook itself?**

Attachments can be large, and most endpoints only need some of them. The payload lists every attachment with a download url; fetch the ones you need with an access token that has the read scope.

**Can I filter by supplier instead?**

Yes. Use From matches, for example *@supplier.example, or a regular expression covering several suppliers. If both From and To/Cc are set, a message must match both.

**Is this included in the free plan?**

Yes. Webhooks, the REST API and access tokens are included free, with up to 5 webhooks per mailbox and up to 10 mailboxes per domain.

## More use cases

[### Support tickets from support@ Send every email to support@ to your helpdesk or your own ticket system as JSON the moment it arrives, with sender, subject, body and attachments. See how →](https://polpomail.com/use-cases/support-tickets) [### Sales enquiries into your CRM Post every email to sales@ to your CRM or lead database as JSON, with your API key in a custom header, so no enquiry gets lost in an inbox. See how →](https://polpomail.com/use-cases/crm-leads) [### Alerts in Slack, Teams or Discord Forward alert, order or VIP emails to a team chat channel: a webhook sends the email to a small function or automation that posts the message. See how →](https://polpomail.com/use-cases/chat-alerts) [### Zapier, Make and n8n without polling Use a webhook as an instant email trigger for no-code automations: point it at a Zapier Catch Hook, a Make custom webhook or an n8n Webhook node. See how →](https://polpomail.com/use-cases/no-code-automation) [### AI triage and auto-sorting Send each new email to your own AI classifier, then file, flag or draft a reply with the REST API: email triage you control, on your own domain. See how →](https://polpomail.com/use-cases/ai-email-triage)

## Start with one webhook.

Free business email on your own domain, with webhooks and a REST API included.

[Create your free workspace](https://polpomail.com/signup)
