> For the complete documentation index, see [llms.txt](https://docs.mindee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindee.com/v1/3rd-party-integrations/zapier/example-using-invoice-ocr-api.md).

# Create a zap using Invoice OCR API

In a typical expense process, invoices that are emailed to your company will have to be saved locally to a computer, and then re-uploaded into an invoicing system. Maybe, even worse, the document must be opened and the details manually entered into the system.

In this post, we’ll build an invoice processing system: invoices that arrive via email will be automatically extracted, and all the data inserted into a Google Sheet.

The best part: No coding required! It will “just work” and will be completely “hands-free” - all the work will be done automatically! If a Google Sheet is not your desired outcome - there are thousands of apps connected with Zapier, so this tutorial can be easily modified to interact with any other application.

The tools required:

1. A Gmail based email account.
2. A free Zapier account (sign up at [Zapier.com](https://zapier.com/))
3. A [Mindee account](https://platform.mindee.com/) with an API key.

## Zapier

Zapier is a no code service that connects different tools with a secure no-code interface.

They call the connections "Zaps". Each Zap has a "trigger" an event that starts the process, and an "action" that occurs after the trigger has fired.

In the case of the Zap we are building, you will need a premium account.

If you are a new user (or if you have a new Zapier account), you'll have free premium access for a week (but your Zap will turn off when the trial ends).

Once you have created a Zapier account, you’ll land at the app dashboard. Click the black "**Create**” button:

<figure><img src="/files/Kpo8SR4WnetFav0ol32Y" alt=""><figcaption></figcaption></figure>

Then Click on **Zaps**

A workflow builder interface is then displayed, with a COPILOT. You can enter in the copilot chat the following text:

{% hint style="info" %}
*When a new email is received on my Gmail account with an attachment, Extract the data using Mindee OCR and send the extracted data to a google sheet.*
{% endhint %}

<figure><img src="/files/rDNfrjXZX5hwjDjKv9O5" alt=""><figcaption></figcaption></figure>

You can then validate the 3 steps by clicking on the + within the copilot.

Let’s Now configure each step:

## Step 1 Gmail

<figure><img src="/files/4lWmdLSUMyuAE5dWvpSn" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure the Trigger Event is **New Attachment.**
{% endhint %}

In an ideal world, you’d set up an address like `invoices@<yourcompany>.com`.

For this demo, I used my Mindee email account.

The next step allows you to filter the emails based on the Gmail label or search string.

Here is where I am able to isolate to just emails with invoices:

```
to:thibault.duvillier+invoice@mindee.co  has:attachment

```

Here I am using a Gmail trick to ensure that only invoices emailed to me are parsed by the Zap.

With Gmail — you can add any value after the + and it acts as a unique email address — but arrives in the same inbox.

<figure><img src="/files/6goEGZvlOPVLvsZ0u5Cl" alt=""><figcaption></figcaption></figure>

\
You can configure which mailbox, or add keywords to ease your finding of a test email.

The search also requires that there is an attachment in addition to being sent to my email address.

Now Zapier will test this trigger to find an email in the account that matches your search query (so now - quickly send an email -with an invoice attachment- to the Gmail account you’ve chosen, so that the search query succeeds).

<figure><img src="/files/y00j2DpANeFkbBdIzCnE" alt=""><figcaption></figcaption></figure>

Once you find the email with the correct attachment, Click on **continue with selected record** to continue configuring your ZAP.

## Step 2 Mindee OCR

First define you **Action event** and validate *Mindee Invoice Parsing* is chosen.

Then connect your Mindee Account.

<figure><img src="/files/j8odE3hAnBeUWTja2efM" alt=""><figcaption></figcaption></figure>

A popup will open with a form, where you will be asked to:

* Enter your account name
* Enter an API key.

<figure><img src="/files/gFobvdUljvvIarjCuckh" alt=""><figcaption></figcaption></figure>

If you do not have a Mindee Account, you can create one on the [Mindee platform](https://platform.mindee.com/).

Then create an API Key by following this [how to](/v1/get-started/create-api-key.md).

Once connected to your Mindee account, click on **Continue.**

Under Your document, choose the option: **Attachment (Exists but not shown)** and click on **Continue.**

<figure><img src="/files/rc7qWVySOmFo7dFJZGjH" alt=""><figcaption></figcaption></figure>

You can now pick the email you have sent with the Invoice sample. Click on **Continue**.

## Step 3 Google Sheet

We've extracted the data from the Gmail attachment - now we want to do something with that attachment.

For the Setup, Select the following:

* Action Event: Create Spreadsheet Row.

Then, connect your Google account to Zapier.

<figure><img src="/files/65guMxj13TsYfsxXE7up" alt=""><figcaption></figcaption></figure>

In this example, we'll add a row in a Google Sheet with all the details from the invoice:

First let’s create the google sheet:

On your Drive:

* Create a new Google Sheet: In our Example *Zapier extraction*.
* Rename the sheet: Invoices
* Add as headers the fields you want to extract. You can propose the name your want here, as in a next step we will add amaping between the payload of Mindee and the columns on the Google sheet. Don’t forget to add the name of the file !

Now, let’s configure the component. In this example we limited the number of fields to be copied to the Google Sheet but the Invoice API propose more than 25 fields.

For each column of your file map it to a key from the Mindee payload. Each field can propose several features. By Default choose the **value**.

<figure><img src="/files/dZp72xENvl7FLWllSoal" alt=""><figcaption></figcaption></figure>

Once the mapping is done Click on **Continue**.

That’s it. Now you can name your Zap and turn it on for use!

## Testing your Zap

Now you can test your Zap by sending another email to your account with an invoice, and after a few minutes - you’ll see the values appear in your spreadsheet automatically from the Zap.

## No Coding with Mindee

With just a few minutes of work (and with zero coding), we have build a fully functional invoice processing system - invoices sent as email attachments are automatically identified, extracted, and the results are placed in a Google Sheet.

We're very excited about the possible opportunities that no-coding options can bring to the Mindee Community!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mindee.com/v1/3rd-party-integrations/zapier/example-using-invoice-ocr-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
