MARKETPLACE
PLUGINS
AWS TEXTRACT - INVOICE & RECEIPT
AWS Textract - Invoice & Receipt logo

AWS Textract - Invoice & Receipt

Published January 2022
   •    Updated this month

Plugin details

Extracts relevant data such as contact information, items purchased, and vendor name, from almost any invoice or receipt without the need for any templates or configuration. Invoices and receipts often use various layouts, making it difficult and time-consuming to manually extract data at scale.   Amazon Textract uses ML to understand the context of invoices and receipts and automatically extracts data such as invoice or receipt date, invoice or receipt number, item prices, total amount, and payment terms to suit your business needs.

Amazon Textract also identifies vendor names that are critical for your workflows but may not be explicitly labeled. For example, Amazon Textract can find the vendor name on a receipt even if it's only indicated within a logo at the top of the page without an explicit key-value pair combination.
Amazon Textract also makes it easy for you to consolidate input from diverse receipts and invoices that use different words for the same concept. For example, Amazon Textract maps relationships between field names in different documents such as customer no., customer number, and account ID, outputting standard taxonomy as INVOICE_RECEIPT_ID. In this case, Amazon Textract represents data consistently across different document types. Fields that do not align with the standard taxonomy are categorized as OTHER.

A script is provided to automatically configure your AWS account settings.

This plugin provides AWS Textract - Invoice & Receipt services in two request modes:
- Synchronous request mode both on front-end, native-mobile and back-end, useful for PNG, JPEG, TIFF, and single-page PDF files for time-sensitive application.
- Asynchronous request mode, useful for PNG, JPEG, TIFF, and large PDF files, time-insensitive application, requiring an AWS S3 Bucket.

⚠ WARNING: This service provides expense-specialised operations based on a document as input. If you intend to detect text in a general-purpose document, please refer to the "AWS Textract - OCR Text & Data" plugin.

The sets of available actions are:

- ANALYZE EXPENSE (Front-End and Back-End for Synchronous, and Asynchronous request mode): Analyzes an input document for financially related relationships between text.

Amazon Textract analysis operations returns the normalised fields described at https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html

In Asynchronous request mode, to interact with AWS S3 and AWS SQS, it is highly recommended to use this plugin in conjunction of our "AWS S3 & SQS UTILITIES" plugin to provide the PUT, GET, and DELETE a file from AWS S3, and POLL QUEUE from AWS SQS action, that you can find here: https://bubble.io/plugin/aws-s3--sqs-utilities-1615057147611x666191530957733900

Demo Link: https://awstextractexpensedemo.bubbleapps.io/version-test

Editor Link: https://bubble.io/page?type=page&name=index&id=awstextractexpensedemo-editor&tab=tabs-1

💡 𝗦𝘂𝗯𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻𝘀 𝗮𝗿𝗲 𝗽𝗿𝗼𝗿𝗮𝘁𝗲𝗱. 𝗜𝗳 𝘆𝗼𝘂 𝗶𝗻𝘀𝘁𝗮𝗹𝗹 𝗮𝗻𝗱 𝘂𝗻𝘀𝘂𝗯𝘀𝗰𝗿𝗶𝗯𝗲 𝘁𝗵𝗶𝘀 𝗽𝗹𝘂𝗴𝗶𝗻 𝗶𝗻 𝗼𝗻𝗲 𝗱𝗮𝘆 𝘁𝗼 𝘁𝗲𝘀𝘁 𝗶𝘁 𝗼𝘂𝘁, 𝘆𝗼𝘂'𝗹𝗹 𝗼𝗻𝗹𝘆 𝗯𝗲 𝗰𝗵𝗮𝗿𝗴𝗲𝗱 𝟭/𝟯𝟬𝘁𝗵 𝗼𝗳 𝘁𝗵𝗲 𝗺𝗼𝗻𝘁𝗵𝗹𝘆 𝘀𝘂𝗯𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻 𝗳𝗲𝗲.

📖 𝗦𝘁𝗲𝗽-𝗯𝘆-𝗦𝘁𝗲𝗽 𝗶𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗶𝗼𝗻𝘀 𝗮𝗿𝗲 𝘁𝗵𝗲 "𝗜𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗶𝗼𝗻𝘀" 𝘀𝗲𝗰𝘁𝗶𝗼𝗻 𝗮𝗻𝗱 𝗗𝗲𝗺𝗼 𝗘𝗱𝗶𝘁𝗼𝗿 𝗶𝘀 𝗶𝗻 𝘁𝗵𝗲 "𝗟𝗶𝗻𝗸𝘀" 𝘀𝗲𝗰𝘁𝗶𝗼𝗻 𝗼𝗳 𝘁𝗵𝗲 𝗣𝗹𝘂𝗴𝗶𝗻 𝗣𝗮𝗴𝗲.

Contact us at [email protected] for any additional feature you would require or support question.

$99

One time  •  Or  $5/mo

5.0 stars   •   1 ratings
22 installs  
This plugin does not collect or track your personal data.

Platform

Web & Native mobile

Contributor details

wise:able logo
wise:able
Joined 2020   •   122 Plugins
View contributor profile

Instructions

Two sets of actions are available in this plugin both in synchronous (front-end and back-end) and asynchronous modes, to extract invoice and receipt data from documents.
0️⃣a : AUTOMATED CONFIGURATION FOR SYNC & ASYNC
=============================================
If you do not have AWS S3 configured yet, the configuration steps can be automatically performed by using this deployment template:
https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleS3&param_BucketName=BucketNameOfYourChoice&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSS3Plugin.yaml

 You will find the required parameters values used to configure your AWS S3 plugin, for which "AWS S3 DROPZONE & SQS UTILITIES" is suggested, in the "OUTPUT" tab of the created stack.

The steps from 0) to 3) b) of START & GET ANALYZE EXPENSE (ASYNC) can be automatically performed by using this deployment template:
 https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleTextract&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSTextractAsync.yaml

 You will find the required parameters values used across the plugin in the "OUTPUT" tab of the created stack.

0️⃣b : AUTOMATED CONFIGURATION FOR SYNC ONLY
=============================================
The steps from 0) to 1) of ANALYZE EXPENSE (SYNC) can be automatically performed by using this deployment template:
 https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleTextractSyncOnly&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSTextractSyncOnly.yaml

 You will find the required parameters values used across the plugin in the "OUTPUT" tab of the created stack.

1️⃣ : AWS TEXTRACT - INVOICE & RECEIPT (FRONT-END DESKTOP & NATIVE MOBILE)
===========================================

📋 ELEMENT DESCRIPTION
--------------------------------
AWS TEXTRACT - INVOICE & RECEIPT element provides ANALYZE EXPENSE action to extract financial data from invoices and receipts. The front-end element is suitable for applications when reactivity is desired, such as but not limited to, mobile applications.

🔧 STEP-BY-STEP SETUP
--------------------------------
ℹ️ The steps from 0) to 1) can be automatically performed by using this deployment template:
https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleTextractSyncOnly&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSTextractSyncOnly.yaml

You will find the required parameters values used across the plugin in the "OUTPUT" tab of the created stack.

0) Sign-up for AWS TEXTRACT by following this link: https://console.aws.amazon.com/textract/home?p=txt&cp=bn&ad=c

1) Create your AWS TEXTRACT ACCESS KEY & ACCESS KEY SECRET, then add to the credentials the AWS TEXTRACT READ-ONLY policy: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys

If you intend to use AWS S3 URI (s3://) with your own BUCKET, attach the AWS S3 READ ONLY policy to the considered BUCKET.

2) Register on plugins.wiseable.io. Create a new Credential which associates your BUBBLE APP URL, AWS TEXTRACT ACCESS KEY & ACCESS KEY SECRET.
The registration service will generate your PUBLIC ACCESS KEY. This key serves as a secure proxy for your real API key. It allows your application to communicate with the service without exposing your real API key. Since this PUBLIC ACCESS KEY is explicitly tied to your registered BUBBLE APP URL, it can only be used from that domain, ensuring that even if the key is publicly visible, it remains safe and cannot be misused by unauthorized sources.

3) In the Plugin Settings, enter the following:
  - PUBLIC ACCESS KEY (generated from plugins.wiseable.io)
  - AWS SERVICE ENDPOINT REGION (if not provided, default endpoint is "us-east-1").

4) Add the AWS TEXTRACT - INVOICE & RECEIPT (FRONT-END DESKTOP & NATIVE MOBILE) element to the page. Select the RESULT DATA TYPE as "RESULT (TEXTRACT - INVOICE & RECEIPT)".

5) Integrate the logic into your application using the following element's states and actions:

FIELDS:
- RESULT DATA TYPE: Returned type, must always be set to "RESULT (TEXTRACT - INVOICE & RECEIPT)".

EVENTS:
- SUCCESS: Event triggered upon success
- ERROR: Event triggered upon error

EXPOSED STATES:
Use any element able to show/process the data of interest (such as a Group with a Text field) stored within the result of the following states:
- RESULTS: Populated upon SUCCESS event. Returns a list of normalized expenses fields, see https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html
- ERROR MESSAGE: Populated upon ERROR event.
- IS PROCESSING: Set to true when processing is in progress, false otherwise.

ELEMENT ACTIONS - TRIGGERED IN WORKFLOW:
- ANALYZE EXPENSE (SYNC) (FRONT-END DESKTOP & NATIVE MOBILE): Analyzes an input document for financially related relationships between text.
 Inputs Fields:
   - IMAGE: Image from the Bubble.io uploader, or a Protocol-relative URLs (//server/file.ext), a HTTPS file URL (https://server/file.ext) or a AWS S3 URI (s3://bucket/image.jpg). For both Protocol-relative and HTTPS URL, the file must be accessible through HTTPS Protocol.

2️⃣ : ANALYZE EXPENSE (SYNC) (BACK-END)
==========================

📋 ACTION DESCRIPTION
--------------------------------
 ANALYZE EXPENSE in a image analyzes an input document for financially related relationships between text.
 Operates in synchronous request mode, useful for small files and time-sensitive application.

🔧 STEP-BY-STEP SETUP
------------------------------
ℹ️ The steps from 0) to 1) can be automatically performed by using this deployment template:
 https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleTextractSyncOnly&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSTextractSyncOnly.yaml

 You will find the required parameters values used across the plugin in the "OUTPUT" tab of the created stack.

 0) Sign-up for AWS TEXTRACT: https://console.aws.amazon.com/textract/home?p=txt&cp=bn&ad=c

 1) Create your AWS TEXTRACT ACCESS KEY & ACCESS KEY SECRET, then add to the credentials the AWS TEXTRACT READ-ONLY policy: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys

 If you intend to use AWS S3 URI (s3://) with your own BUCKET, attach the AWS S3 READ ONLY policy to the considered BUCKET.

 2) In the Plugin Settings, enter the following:
     - AWS TEXTRACT ACCESS KEY & ACCESS KEY SECRET
     - AWS SERVICE ENDPOINT REGION (if not provided, default endpoint is "us-east-1").

 3) Set up the action "ANALYZE EXPENSE (BACK-END)" in the workflow.
   Inputs Fields:
     - IMAGE: JPEG, TIFF, PNG image or PDF (single-page) file from the Bubble.io uploader, or a Protocol-relative URLs (//server/file.ext), a HTTPS file URL (https://server/file.ext) or a AWS S3 URI (s3://bucket/image.jpg). For both Protocol-relative and HTTPS URL, the file must be accessible through HTTPS Protocol.
     - RESULT DATA TYPE: Returned type, must always be set to "RESULT (TEXTRACT)".
   Output Fields:
     - RESULTS: Returns a list of normalized expenses fields, see https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html

3️⃣ : START & GET ANALYZE EXPENSE (ASYNC)
========================================

📋 ACTION DESCRIPTION
--------------------------------
 ANALYZE EXPENSE in a JPEG, PNG, PDF file stored in AWS S3 to return financially related relationships between text.
 Asynchronous request mode, useful for large files and time-insensitive application.

🔧 STEP-BY-STEP SETUP
--------------------------------
ℹ️ The steps from 0) to 3) b) can be automatically performed by using this deployment template:
 https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?stackName=BubbleTextract&templateURL=https://bubble-resources.s3.amazonaws.com/deployment-assets/CloudFormation-AWSTextractAsync.yaml

 You will find the required parameters values used across the plugin in the "OUTPUT" tab of the created stack.

 0) Sign-up for AWS TEXTRACT: https://console.aws.amazon.com/textract/home?p=txt&cp=bn&ad=c

 1) Configure AWS TEXTRACT FOR ASYNCHRONOUS OPERATION by following ALL the instructions: https://docs.aws.amazon.com/textract/latest/dg/api-async-roles.html

   Write down your:
     - ACCESS KEY & ACCESS KEY SECRET
     - AWS SERVICE ENDPOINT REGION
     - NOTIFICATION ROLE ARN
     - SNS TOPIC ARN
     - QUEUE URL

 2) In the Plugin Settings, enter the following:
     - AWS TEXTRACT ACCESS KEY & ACCESS KEY SECRET
     - AWS SERVICE ENDPOINT REGION (if not provided, default endpoint is "us-east-1").

 3) Set-up in your workflow an action returning the BUCKET and KEY of your file to analyze.
   a) If you do not already have such action, install the plugin "AWS S3 & SQS UTILITIES"
   b) Create a AWS S3 BUCKET that will be used to store the file to analyze: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html
   c) Set up the "PUT FILE TO S3" action in the workflow.
     Inputs Fields:
       - FILE URL TO STORE: The file URL from the Bubble.io uploader, or a Protocol-relative URLs (//server/file.ext), or a HTTPS file URL (https://server/file.ext). The file must be accessible through the HTTPS protocol.
       - AWS S3 BUCKET NAME: AWS S3 Bucket Name to which the file will be saved.
       - AWS S3 FILE NAME: Path & Name of the file to put to AWS S3. The format must be [path/]filename.ext.
           Example 1: path1/path2/filename.ext.
           Example 2: filename.ext if the file is at the root of the bucket.

 4) Set up the "START ANALYZE EXPENSE JOB (ASYNC)" action in the workflow.
   Inputs Fields:
   - AWS S3 BUCKET NAME: AWS S3 bucket name from which the input file will be read.
   - AWS S3 FILE NAME: Path & Name of the JPEG, PNG, PDF file to get from AWS S3. The format must be [path/]filename.ext.
       Example 1: path1/path2/filename.ext.
       Example 2: filename.ext if the file is at the root of the bucket.
   - NOTIFICATION ROLE ARN: The ARN of an IAM role giving AWS TEXTRACT publishing permissions to the Amazon SNS topic.
   - SNS TOPIC ARN: The AWS SNS topic ARN to which AWS TEXTRACT posts the completion status.
   Output Fields:
     - JOB ID: ID of the Job, to be reused in the "GET JOB STATUS FROM SQS" and "GET ANALYZE EXPENSE RESULTS".

 5) Install the plugin "AWS S3 & SQS UTILITIES"
   Set up the action "GET JOB STATUS FROM SQS" in a recurring workflow ('Do every x seconds') AWS TEXTRACT job status messages with the JOBID.
   Configure this recurring workflow to execute the next step once the job status is SUCCEEDED, using 'Only When' Event Condition, to retrieve the results.
     Inputs Fields:
       - QUEUE URL: URL of AWS SQS you set up at step 1, used to poll for AWS TEXTRACT job status messages.
       - JOBID: ID of the job to poll, returned by "START ANALYZE EXPENSE JOB" action.
     Output Fields:
       - JOB STATUS: Valid values are SUCCEEDED, POLLING, IN_PROGRESS, PARTIAL_SUCCESS and FAILED or ERROR, with error or failure messages being appended to the status.

 6) Set up the action "GET ANALYZE EXPENSE RESULTS (ASYNC)" in the workflow.
   Inputs Fields:
     - JOB ID: ID of the job to poll, returned by "START ANALYZE EXPENSE JOB" action.
     - MAX RESULTS: Maximum results per paginated calls from AWS. The largest value you can specify is 1000, any greater value wil return 1000 results. The default value is 1000. This plugin auto-paginates AWS response based on this parameter.
     - RESULT DATA TYPE: Returned type, must always be set to "RESULT (TEXTRACT)".
   Output Fields:
     - RESULTS: Returns a list of normalized expenses fields, see https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html

🔍 IMPLEMENTATION EXAMPLE
======================
Feel free to browse the app editor in the Service URL for an implementation example.

ℹ️ ADDITIONAL INFORMATION
======================
> Standard Fields details: https://docs.aws.amazon.com/textract/latest/dg/invoices-receipts.html

> AWS TEXTRACT service limits: https://docs.aws.amazon.com/textract/latest/dg/limits.html
> AWS services availability per region: https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
> AWS Service endpoints list: https://docs.aws.amazon.com/general/latest/gr/rande.html

⚠️ TROUBLESHOOTING
================

Any plugin related error will be posted to the the Logs tab, "Server logs" section of your App Editor.
Make sure "Plugin server side logging" and "Plugin client side logging" is selected in "Show Advanced".

For front-end actions, you can also open your browser's developer console (F12 or Ctrl+Shift+I in most browsers) to view detailed error messages and logs.

Always check the ERROR MESSAGE state of the element and implement error handling using the ERROR event to provide a better user experience.

> Server Logs Details: https://manual.bubble.io/core-resources/bubbles-interface/logs-tab#server-logs

⚡ PERFORMANCE CONSIDERATIONS
===========================

GENERAL
-------------
For back-end actions, the maximum processing duration is capped at 30 seconds as per Bubble.io design. This time limitation does not apply to front-end actions.

⏱️ BACK-END ACTION START DELAY
-----------------------------------------------
Each time a server-side action is called, Bubble initializes a small virtual machine to execute the action. If the same action is called shortly after, the caching mechanism kicks in, resulting in faster execution on subsequent calls.

A useful workaround is to fire a dummy execution at page load, which pre-warms the Bubble engine for the next few minutes, reducing the impact of cold starts for your users.

FRONT-END VS BACK-END PROCESSING
----------------------------------------------------
The front-end element is designed to support and optimize multiple image formats and will automatically compress images to adhere to AWS requirements. The back-end action doesn't perform this optimization, so be careful with file size and format when using it.

❓ QUESTIONS?
===========
Contact us at [email protected] for any additional feature you would require or support question.

Types

This plugin can be found under the following types:
Api   •   Background Services   •   Element   •   Event   •   Action

Categories

This plugin can be found under the following categories:
Productivity   •   Technical   •   AI   •   Image   •   Mobile   •   Visual Elements

Resources

Support contact
Documentation
Tutorial

Rating and reviews

Average rating (5.0)

Works as expected
December 9th, 2022
Using it to process invoices on a backend workflow right now, works very well.
Bubble