Read Data from Invoice and load into a database or excel

@EmeraldHerald here the link of invoices i am working with you can access
https://drive.google.com/drive/folders/1St1-zMwWl3gaEKPLgPxlx2fbxpDE6ss8

Hi @Arudhra - that link only returns one data file:

Can you please try adding this node after your HTTP Request node:

And seeing if that works for you? If not, can you share where in your workflow you’re getting stuck with sample data? As @MutedJam mentioned above, your workflow runs just fine with what you’ve provided :+1:

@EmeraldHerald Error: Unable to read the binary file

You’re not receiving the data from the HTTP Request node as binary data, so there’s no file for the Read PDF node to operate on - you can change that like this, in the HTTP Request node under Options → Response:

When using your file and fixing this up, however, I am getting the error “Invalid PDF Structure”, but this would be an issue with the file you’re sending to n8n. I’m not having any issues when using a sample PDF such as the one here: https://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf

That being said, it’s entirely possible it matches the structure Mindee expects - you can try to take out that Read PDF node to test that. There’s otherwise an issue with the file itself :bowing_man:

@EmeraldHerald Did you try placing the file in the folder and reading the file from the folder, if so can you send me the workflow

Hey @Arudhra,

You shouldn’t need the Read PDF node before the Mindee node, Can you share what the output of the HTTP Request node looks like and also the input and output of the Mindee node?

@Jon Here is the output i am getting from HTML request

@Jon here is the complete workflow

The output there is pdf so for the binary data property in the next node should be pdf instead of data but if you are sending the PDF to Mindee there is no need to read the PDF in n8n just send it direct.

@Jon I am getting HTML output from HTTP request

i am getting the below error

404 - {“api_request”:{“error”:{“code”:“NotFound”,“details”:“SubscriptionProduct not found”,“message”:“Resource not found”},“resources”:[],“status”:“failure”,“status_code”:404,“url”:“https://api.mindee.net/v1/products/mindee/expense_receipts/v4/predict”}} - 404 - {“api_request”:{“error”:{“code”:“NotFound”,“details”:“SubscriptionProduct not found”,“message”:“Resource not found”},“resources”:[],“status”:“failure”,“status_code”:404,“url”:“https://api.mindee.net/v1/products/mindee/expense_receipts/v4/predict”}}

Details

Time

10/20/2023, 7:21:43 PM

Stack

NodeApiError: The resource you are requesting could not be found
    at Object.mindeeApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Mindee/GenericFunctions.js:39:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Mindee/Mindee.node.js:221:44)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:631:53

Mindee

Execute node

Parameters


Docs

Credential for Mindee Receipt API

Resource

Operation

Binary Property

Fixed

Expression

RAW Data

Fixed

Expression

I wish this node would…

Problem in node ‘Mindee‘

The resource you are requesting could not be found

Hey @Arudhra,

That error is saying that data in the Binary Property doesn’t exist. If you look at the input binary item it is actually called pdf so if you change the Binary property to pdf it should work.

On the second one if you go to the nodes settings for the Mindee node change the API Version from 1 to 4 and that should work.

@Jon i have changed the API version
But still getting the same error above
can you guide me where to change the binary property

Hey @Arudhra,

Which error? You can set the property here…

I am getting I valid file type

00 - {“api_request”:{“error”:{“code”:“BadRequest”,“details”:{“document”:[“Invalid file type: text/html”]},“message”:“Invalid fields in form”},“resources”:[],“status”:“failure”,“status_code”:400,“url”:“https://api.mindee.net/v1/products/mindee/invoices/v4/predict”}} - 400 - {“api_request”:{“error”:{“code”:“BadRequest”,“details”:{“document”:[“Invalid file type: text/html”]},“message”:“Invalid fields in form”},“resources”:[],“status”:“failure”,“status_code”:400,“url”:“https://api.mindee.net/v1/products/mindee/invoices/v4/predict”}}

Ah yeah that file is an html file not a PDF file. Can you try downloading a PDF file to see if you get the same issue.

If i download the PDF file i am getting HTML only

Can you show me what the output looks like with a PDF file?

https://drive.google.com/drive/folders/1St1-zMwWl3gaEKPLgPxlx2fbxpDE6ss8

here is the PDF files

Can you show me what the output looks like in n8n when you download one of the PDF files?