A Step-by-Step Guide to implementing AI in your App using IFTTT
Tags: ai, api, ifttt, aiautomation
Published: 2023-03-09 15:24:53

*In this tutorial, we'll show you how to integrate Eden AI's [Invoice parser API](http://www.edenai.co/feature/ocr-invoice?referral=integrate-invoice-parser-ifttt) into your software using IFTTT to help streamline your financial operations and free up time for more important tasks. The same process applies if you want to include other features like : [Image tagging](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-ifttt), [Explicit content detection](http://www.edenai.co/feature/explicit-content-detection?referral=integrate-invoice-parser-ifttt), [Text analysis](https://www.edenai.co/technologies/text?referral=integrate-invoice-parser-ifttt) and many more AI APIs we offer.*

‍

## **Build AI on IFTTT with Eden AI**

Eden AI was created for no-coders having difficulties with choosing the right AI provider and/or integrating several APIs. Managing multiple accounts for each app can be a tough job, but with Eden AI, you can connect and manage all your APIs on a single account. Since some AI providers can be complex to use, we wanted to simplify the “no code” part and make AI available to as many people as possible.

Eden AI allows you to solve multiple AI tasks on IFTTT:

- [Document parsing](https://www.edenai.co/feature/ocr?referral=integrate-invoice-parser-ifttt) : extracting text from images and [parsing invoice](https://www.edenai.co/feature/ocr?referral=integrate-invoice-parser-ifttt), [receipt](https://www.edenai.co/feature/ocr-receip?referral=integrate-invoice-parser-ifttt) or resume to extract data
- [Computer vision](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-ifttt): detect [faces](https://www.edenai.co/feature/face-detection?referral=integrate-invoice-parser-ifttt), [objects](https://www.edenai.co/feature/object-detection?referral=integrate-invoice-parser-ifttt), logos, [explicit content](https://www.edenai.co/feature/explicit-content-detection?referral=integrate-invoice-parser-ifttt), etc.
- Text analysis : [sentiment analysis](https://www.edenai.co/feature/sentiment-analysis?referral=integrate-invoice-parser-ifttt), [keyword extraction](https://www.edenai.co/feature/keyword-extraction?referral=integrate-invoice-parser-ifttt), [summarization](https://www.edenai.co/feature/summarization?referral=integrate-invoice-parser-ifttt), etc.
- [Machine Translation](https://www.edenai.co/post/best-machine-translation-apis?referral=integrate-invoice-parser-ifttt)
- [Speech recognition](https://www.edenai.co/post/which-speech-recognition-api-to-choose-for-your-project?referral=integrate-invoice-parser-ifttt) & Speech generation

‍

## **Let's practice with [Invoice parsing](http://www.edenai.co/feature/ocr-invoice?referral=integrate-invoice-parser-ifttt)!**

Just like [Receipt](https://www.edenai.co/post/top-10-ocr-receipt-parser-api?referral=integrate-invoice-parser-ifttt) and [Resume](https://www.edenai.co/post/top-10-ocr-resume-parser-api?referral=integrate-invoice-parser-ifttt) Parsing, Invoice Parsing is a tool powered by [OCR](https://www.edenai.co/post/analyze-easily-document-files-with-ai-optical-character-recognition-ocr?referral=integrate-invoice-parser-ifttt) to extract and digitalize meaningful data, [Computer Vision](https://www.edenai.co/post/best-computer-vision-apis?referral=integrate-invoice-parser-ifttt) to identify structure of the document, and [NLP](https://www.edenai.co/post/best-natural-language-processing-apis?referral=integrate-invoice-parser-ifttt) techniques to pin down the fields. Invoice parser technology extracts key information from an invoice (.pdf, .png or .jpg format) such as the invoice ID, total amount due, invoice date, customer name, etc.


![Invoice Parsing results on Eden AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xl7k1rogv7szzzo5ycf1.png)

Invoice Processing implies the necessity of software and technology to automate the processing and management of invoices. It includes tasks such as capturing invoice data, validating it in comparison to purchase orders, and routing it for approval, payment and archiving. The goal of AI in invoice processing is to improve efficiency, accuracy, and speed in handling invoices without any human intervention.

**[Try Eden AI for FREE](https://app.edenai.run/user/register?referral=integrate-invoice-parser-ifttt)**

## **How to add invoice parsing to your app with IFTTT?**

To better understand the capabilities of using Eden AI, let’s see in the example below how to use the Eden AI applet.

In this example, you can send an email containing an invoice file to the “Email integrations” Applet, which will extract the file, pass it to the “Eden AI” applet, which in turn will process the file and send the extracted information to the sender.

‍

### **1. Add a "If This" trigger**

Start by choosing the Email integrations applet to automatically extract an URL path of the file received in the email, serving as a “trigger”: **the “If this” part of the equation**. The applet will return some information.

For this example, we will consider only the two ingredients: “AttachmentUrl” which will contain an URL path of the invoice file sent to the email address, and the “from” ingredient which will contain the email address of the sender:

‍

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e216f4e7da17327d25936d_vlLWuP9hknrEqNXRt-SDHcYrSna_7kWTqDxlrC3EIPqnREl-A37iuV-4cd2eWUfVjpO-vKYoL5HyvyZmU-lUx0XoqWofu-mJwAgdtoz5LgcieAznJNjEnxuD21-dSzOfJaEJWHGO9ptis6VG4RM6gu8.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e216f4e7da17327d25936d_vlLWuP9hknrEqNXRt-SDHcYrSna_7kWTqDxlrC3EIPqnREl-A37iuV-4cd2eWUfVjpO-vKYoL5HyvyZmU-lUx0XoqWofu-mJwAgdtoz5LgcieAznJNjEnxuD21-dSzOfJaEJWHGO9ptis6VG4RM6gu8.png)

‍

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e216f45665c79600c52855_6AtjWkHHAPB_3mTwAjj87DSohWDKKUeWSU-R1lPv4xNWDplluU6uIHO4YUQlrdBr8DFMo44UGLh6OYXZk7I-BguzrFI05Fka0ozQi24LC9uEKOpzhRlXVfQshAtWKgkIZqHuHCmGPb2w3p7aQCUXeCs.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e216f45665c79600c52855_6AtjWkHHAPB_3mTwAjj87DSohWDKKUeWSU-R1lPv4xNWDplluU6uIHO4YUQlrdBr8DFMo44UGLh6OYXZk7I-BguzrFI05Fka0ozQi24LC9uEKOpzhRlXVfQshAtWKgkIZqHuHCmGPb2w3p7aQCUXeCs.png)

‍

### **2. Add a "Then That" trigger**

Next , select the second part of the equation: “then that”. We will be using the “Eden AI”  Applet to process  the file returned, and send back the data extracted to the email address specified in the Applet

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e218c1f042c5f6f58eac41_iwMXDcl4swFk1MFaMscc4jPl6uvA_M7CU2VwoWqfE43itM0MkoMTJY0rJmnKy-ajqV64zZte4Pwh1Iwq35KaoGMm3YITUkzb2VJS7vpdsAySc0cWEfYESXO3rP8rCXDHoowodXoXTPrycszQQnnOxe4.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e218c1f042c5f6f58eac41_iwMXDcl4swFk1MFaMscc4jPl6uvA_M7CU2VwoWqfE43itM0MkoMTJY0rJmnKy-ajqV64zZte4Pwh1Iwq35KaoGMm3YITUkzb2VJS7vpdsAySc0cWEfYESXO3rP8rCXDHoowodXoXTPrycszQQnnOxe4.png)

‍

An action “perform invoice processing”, is created with two “action fields”: **file_rul** and **Email address**. The file_rul will be automatically populated with the “AttachmentUrl” ingredient and the Email address with the “from” ingredient.

Of course, you can choose other ingredients provided by the “Email” applet, but for the purpose of this example, you will only need these two ingredients.

‍

![https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e218c1a5eca99eea9a9b21_jNOVZphTF5X5cUSH45gumnB4ayOXXYqvHz2QTKphD9Eopkj6Zy2-p6Msh-hWPcN2uyUml_aNmhz81Eqvfp7TBfcp-DejAM27pMHkQ-X6yGhw__5vAwSfJEzEt9JYtJcqchUBJIDRYQxRu25Agibn5_U.png](https://uploads-ssl.webflow.com/61e7d259b7746e3f63f0b6be/63e218c1a5eca99eea9a9b21_jNOVZphTF5X5cUSH45gumnB4ayOXXYqvHz2QTKphD9Eopkj6Zy2-p6Msh-hWPcN2uyUml_aNmhz81Eqvfp7TBfcp-DejAM27pMHkQ-X6yGhw__5vAwSfJEzEt9JYtJcqchUBJIDRYQxRu25Agibn5_U.png)

‍

### **3. Add an action to launch the invoice processing**

In order to implement the Eden AI applet efficiently, please follow the the guidelines below to start building a simple service [https://ifttt.com/docs/example_services](https://ifttt.com/docs/example_services?referral=integrate-invoice-parser-ifttt).

Then, you'll need to add an action to launch the invoice processing after receiving the file URL as follows:

```
@app.post('/ifttt/v1/actions/post_invoice_document', status_code=status.HTTP_200_OK)
def post_invoice_document(action_field : dict):
   # action fields
   file_url = action_field["actionFields"]["file_url"]
   email = action_field["actionFields"]["email_address"]
   # get file content from the file path url
   file_content = http.request("GET", file_url)
   # perform the Eden AI invoice processing
   edenai_ai_response= edenai_invoice_parser("en", ["amazon"], file_content.data)
   data = edenai_ai_response["extracted_data"][0]
   # translate the json response to an html code to be sent as an email body
   body_html = format_json_html(data)
   # send an email to the user
   send_email("Invoice informations", body_html, [email])
   # return the data or something else
   return {
       "data" : {
           **data,
       }
   }
```
The endpoint “post_invoice_document” will grab the specified action fields as explained above. After that, it will get the file content from the the URL. Using the file content’s bytes, you will launch an Invoice parser using the Eden AI API (simple lines to run an invoice processing using Eden AI are shown below).

```
def edenai_invoice_parser(language:str, providers: list, file: bytes):
   headers = {"Authorization": f"Bearer {EDENAI_KEY}"}


   url="https://api.edenai.run/v2/ocr/invoice_parser"
   data={
       "providers": providers,
       "language": language}


   files = {'file': file}


   response = requests.post(url, data=data, files=files, headers=headers)
   return response.json()["amazon"]
```
For reasons of simplicity, we'll be using Amazon Web Services as a provider to perform this invoice processing.

‍

### **4. 🥳 Let's test applet!**

Last but not least, you'll need to send an email to the following email address: [trigger@applet.ifttt.com](mailto:trigger@applet.ifttt.com?referral=integrate-invoice-parser-ifttt) with an attached invoice file to test the applet. You will receive an email containing all the data extracted from the invoice file into the same email inbox.

{% youtube krlqAnR34zg %}

*If you're interesting in more low-code tools, have a look at our step-by-step tutorials on how to bring AI to your application with [Power Apps](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-edenai-invoice-parser-on-microsoft-powerapps?referral=integrate-invoice-parser-ifttt), [Google App Script](https://www.edenai.co/post/a-step-by-step-guide-to-integrating-ai-in-your-app-with-google-app-script?referral=integrate-invoice-parser-ifttt), [Retool](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-using-retool?referral=integrate-invoice-parser-ifttt), [Make](https://www.edenai.co/post/how-to-integrate-invoice-parsing-into-your-application-using-make?referral=integrate-invoice-parser-ifttt), [n8n](https://www.edenai.co/post/a-step-by-step-guide-to-implementing-ai-in-your-app-with-n8n?referral=integrate-invoice-parser-ifttt), [Bubble](https://www.edenai.co/post/a-step-by-step-guide-to-bring-ai-to-your-app-using-bubble?referral=integrate-invoice-parser-ifttt), [Dataiku](https://www.edenai.co/post/a-step-by-step-guide-to-bring-ai-to-your-app-using-daitaku-dss?referral=integrate-invoice-parser-ifttt), and [Zapier](https://www.edenai.co/post/a-step-by-step-guide-to-bring-ai-to-your-app-using-zapier?referral=integrate-invoice-parser-ifttt).*

‍

**[Create your Account on Eden AI](https://app.edenai.run/user/register?referral=integrate-invoice-parser-ifttt)**