Auto-file emailed vendor invoices as QuickBooks bills

Every 30 minutes, an agent turns labeled invoice PDFs in Gmail into clean vendor bills in QuickBooks, and flags anything shaky for review.

Agentic Task
GmailPDF.coQuickBooks OnlineFinanceOperationsDocument ProcessingData SyncEmail Automation
PromptCreate

Build an agent workflow that files vendor invoices from Gmail into QuickBooks Online as bills, so accounts payable doesn't have to hand-key them.

Trigger: cron, every 30 minutes.

On each run, the agent should:

1. Use Gmail List Messages to fetch messages that carry a label called 'Bills to file' and do NOT already carry a label called 'Filed to QuickBooks'. If either label doesn't exist yet in the account, create it. Cap the batch at something sensible per run (e.g. 20 messages) so a big backlog doesn't blow up a single execution.

2. For each matching message, look at its attachments. For every PDF attachment, use Gmail Get Attachment to pull it down.

3. Run each PDF through PDF.co's AI Invoice Parser to extract vendor name, vendor contact info if present, line items (description, quantity, unit price, amount), invoice number, invoice date, due date, subtotal, tax, and total.

4. Sanity-check the extraction. If the parser can't confidently produce a vendor + total + at least one line item, OR the document is obviously not an invoice (statement, contract, marketing PDF, receipt with no line items), skip the bill creation, do NOT apply the Filed to QuickBooks label, and use Gmail Reply to a Message to send a short reply to the sender flagging it for manual review. Keep the reply polite and specific about why it wasn't auto-filed.

5. If the extraction looks good, use QuickBooks Query Entities to look up the vendor by name (fuzzy match on DisplayName). If no vendor exists, use Create Vendor to add one with the vendor name and any contact info the parser surfaced. Reuse an existing vendor if there's a clear match.

6. Use QuickBooks Create Bill to post the invoice as an accounts payable bill for that vendor, with the parsed line items mapped to the appropriate expense account (default to a general expense account if the agent isn't sure), the invoice number in DocNumber, the invoice date as TxnDate, and the parsed due date as DueDate. Total should reconcile against the sum of line items.

7. Once the bill is created successfully, use Gmail Modify Message Labels to add a 'Filed to QuickBooks' label to the original email so the same invoice never gets posted twice. Optionally remove the 'Bills to file' label at the same time.

Bias hard toward NOT creating a bill when confidence is shaky. It is much better to reply for manual review than to push bad data into QuickBooks. Never create a bill without a matching or newly-created vendor, and never create a bill for a total the parser is not confident about.

Log what happened per message (posted vs. skipped-for-review vs. errored) so the user can spot-check runs.

Additional information

What does this prompt do?
  • Checks your Gmail every 30 minutes for messages you've tagged with a Bills to file label.
  • Reads each PDF attachment and pulls out the vendor, line items, invoice number, totals, and due date.
  • Finds or creates the vendor in QuickBooks Online and posts a fully coded bill to accounts payable.
  • Marks the email as filed so nothing gets posted twice, and replies asking for a human when a PDF looks off.
What do I need to use this?
  • A Gmail account where vendor invoices arrive, with a Bills to file label you can apply to incoming invoices.
  • A QuickBooks Online company where new bills should be created.
  • A PDF.co account for reading the invoice PDFs.
How can I customize it?
  • Change how often the agent checks Gmail, for example every 15 minutes or once an hour.
  • Swap the Bills to file label for whatever label your team already uses on invoice emails.
  • Adjust the confidence bar for when the agent should post a bill on its own versus reply for review.

Frequently asked questions

Will this create duplicate bills if the same invoice comes through twice?
No. After a bill is posted to QuickBooks the email gets a Filed to QuickBooks label, and the agent skips anything that already has that label on the next run.
What happens if a PDF isn't really an invoice, like a statement or a contract?
The agent does not post a bill. It replies to the sender flagging the message for manual review and leaves the Filed label off, so you can decide what to do.
How does it handle vendors that don't exist in QuickBooks yet?
It searches QuickBooks first, and if no matching vendor is found it creates a new vendor record using the name and contact details from the invoice before posting the bill.
Can I control which emails it looks at?
Yes. It only reads messages that carry the Bills to file label you pick, so a simple Gmail filter or a manual label click is all it takes to hand an invoice off to the agent.
Do I need to manually approve every bill it creates?
By default no, but the agent errs on the side of not posting when the parser's confidence is low. You can tighten or loosen that threshold when you set it up.

Stop hand-keying vendor invoices into QuickBooks.

Label an invoice in Gmail and let the agent post the bill, create missing vendors, and flag anything that looks off.