Quick Overview
This workflow reads Japanese invoices with Gemini, checks the required fields and the tax for each rate, and looks up the seller’s registration number in the National Tax Agency qualified invoice registry on the invoice date. An accountant accepts or returns the invoices in Slack, and the results are saved to an n8n Data Table. Once a month, it re-checks accepted suppliers and reports any registration that has lapsed, been cancelled or renamed.
How it works
- Invoices (PDF or image, up to 10) are uploaded through a form.
- Gemini reads each invoice. A Code step normalizes the registration number and dates (including Japanese era dates) and checks the required fields, the tax for each rate and the total.
- The NTA Web-API returns the seller’s registration status on the invoice date. The workflow flags numbers that are not found, registered after the invoice date, cancelled or expired, and seller names that do not match.
- Past checks in the Data Table are used to catch duplicate invoices.
- If anything needs attention, Slack asks the accountant which invoices to accept and why the others are returned, and drafts a message to each supplier.
- Every result is saved, and on the first of each month the accepted suppliers are looked up again.
Setup
- Apply for an NTA Web-API application ID and add it as a Query Auth credential with the parameter name
id.
- Create a Data Table named
invoice_checks with string columns.
- Add Google Gemini and Slack credentials, and set the Slack channel.
- Set the workflow time zone to Asia/Tokyo.
This helps with checking invoices; it is not tax advice.