# Automated NetSuite Billing and Shipment Processing

> Automation that extracts invoice and shipment details from incoming emails, matches them with NetSuite records, and prepares shipment notifications.

Section: Make Automations

Page: https://mburhan.com/case/automated-netsuite-billing-and-shipment-processing

### Overview

This solution connects Microsoft Outlook, OCR.space, OpenAI, and NetSuite through Make. It processes incoming billing emails and PDF attachments, extracts purchase order numbers, tracking IDs, and vendor information, matches the information with NetSuite transactions, and prepares shipment-related email notifications. It also sends an alert when OCR processing encounters an error.

### The Problem

Billing teams manually review incoming emails, download invoices and shipment documents, extract key details, and match them with NetSuite records. This repetitive process takes time and increases the risk of missing information or incorrect transaction matching.

### How It Works

The solution uses a Make scenario to process incoming billing emails and their attachments.

1. **Monitor Billing Emails.** Microsoft Outlook watches the configured billing inbox for incoming messages.
2. **Apply Email Conditions.** The workflow checks sender and subject details to determine which messages should proceed.
3. **Retrieve Attachments.** It lists the available attachments and downloads the relevant files.
4. **Filter PDF Documents.** PDF attachments proceed through the document-processing route, with a short delay before extraction.
5. **Extract Document Text.** OCR.space processes the PDF and returns its extracted text.
6. **Handle OCR Errors.** If the OCR request encounters an error, the workflow sends an email alert to the configured recipient.
7. **Prepare Extraction Inputs.** The email preview and extracted PDF text are stored for further processing.
8. **Extract Purchase Order and Tracking Details.** OpenAI identifies purchase order numbers and tracking IDs from the available email and document content.
9. **Identify Vendor Information.** A separate OpenAI step extracts vendor details, and the returned information is parsed into structured fields.
10. **Search NetSuite Transactions.** The workflow searches NetSuite for records matching the extracted information and retrieves the relevant transaction details.
11. **Prepare Item Information.** Related transaction items are collected and processed into a structured list for the notification.
12. **Prepare Shipment Emails.** The workflow combines the retrieved transaction, item, and shipment information to prepare the relevant email.
13. **Send Notifications.** Microsoft Outlook sends the shipment-related email using the prepared information.

Image (https://mburhan.com/uploads/caed3e789f10aa5f09a5d07d.png)

Image (https://mburhan.com/uploads/11215d54721d4d0d7714a452.png)

### The Result

The automation connects incoming billing documents with the corresponding NetSuite records and shipment notifications. Instead of manually reviewing every email, downloading documents, extracting details, and searching transactions, the workflow handles these steps automatically. It also provides an email alert when OCR processing fails, helping the team identify document-processing issues.

**Execution Metrics**

| Metric | Result |
| --- | --- |
| Total executions | 164 |
| Successful executions | 158 |
| Success rate | \~95% |
| Average execution time | 17.15 seconds |

*Note:Metrics are based on the available execution logs and may vary depending on email volume, attachment processing, and document complexity.*

Image (https://mburhan.com/uploads/a748080b643f2707522772e9.png)

### Tech Stack

**Make:** Coordinates the complete workflow, including email routing, attachment processing, data extraction, transaction matching, and error handling.

**Microsoft Outlook:** Monitors the billing inbox, retrieves email attachments, and sends shipment notifications and OCR error alerts.

**OCR.space API:** Extracts readable text from PDF attachments for further processing.

**OpenAI:** Extracts purchase order numbers, tracking IDs, and vendor information from email and document content.

**NetSuite:** Provides transaction and item records used to match extracted billing and shipment information.

**JavaScript:** Supports custom data processing and prepares structured item information for email notifications.

The team can continue using Outlook and NetSuite without replacing its existing email or business management systems.

### Where This Pattern Applies

This is not limited to billing and shipment processing. Imagine an e-commerce business receiving supplier invoices, delivery documents, and tracking information through email. The automation extracts the relevant details, finds matching order records, and prepares the next notification without requiring someone to process every document manually.

The same approach can be adapted to:

- **E-commerce:** Order and shipment document processing
- **Logistics:** Delivery documents and tracking details
- **Finance:** Invoice and purchase order processing
- **Procurement:** Supplier document management
- **Distribution:** Shipment records and customer notifications
- **Healthcare Supply:** Medical supply invoices and delivery documentation

The reusable pattern remains the same: receive documents, extract information, identify relevant details, match existing records, and trigger the next action. What changes is the document type, the system being searched, and the action that follows.
