Articles in this section

Email Remittance Manager quickstart integration template

Summary: The Email Remittance Manager is a standalone integrator.io platform template that automates cash application for email-based remittances. It reads remittance advice from a Gmail inbox, extracts payment data using an AI agent, matches payments against open NetSuite invoices, and posts customer payments and deduction journals to NetSuite automatically. Use this template when your team receives remittance emails and currently processes them manually.

The Email Remittance Manager connects Gmail and NetSuite to automate the full remittance-to-cash cycle. The template includes a single flow that reads incoming remittance emails from a shared Gmail inbox, extracts structured payment data using an AI agent, matches extracted payments against live NetSuite open invoices, classifies short pays, over pays, and deductions by reason code, auto-posts customer payments and deduction journals to NetSuite, and routes records that can't be processed automatically to integrator.io error management for review and retry.

This article covers how to install the template, set up the exception gate, configure your connections, and configure the template settings before your first run.

Supported integration flow

The Email Remittance Manager template contains one flow named Email Remittance Manager. The flow runs the following steps in sequence.

Email Remittance Manager flow steps

Step

Step name What it does
1 ERM - Read remittance emails Reads messages from Gmail using the label:remittance query
2 ERM - Get email details Retrieves the full email body, headers, and attachment metadata
3 ERM - Get attachment content Decodes text and CSV attachments from the email
4 ERM - Extract remittance data (AI agent) Uses an AI agent to extract structured payment data from the email body and attachments

5

ERM - Open AR invoices (NetSuite lookup) Fetches open invoices from NetSuite; the matching engine runs as a post-response hook on this step and writes payment, journal, and CSV rows to the record

6

ERM - Categorize & route exceptions (gate) Routes records to integrator.io error management if they don't meet the confidence threshold or matching criteria

7

ERM - Create customer payment (NetSuite) Posts matched customer payments to NetSuite

8

ERM - Create deduction journal (NetSuite) Creates a two-line deduction journal in NetSuite for each identified reason code

9

ERM - Write output CSV (O/P file) Writes a result CSV named EMAILREMIT_RESULTS_<timestamp>.csv to your SFTP server

Before you begin

Before you install the template, make sure you have the accounts and credentials listed in this section ready.

Gmail

You must have:

  • A Gmail or Google Workspace account with a shared remittance inbox
  • A remittance label in Gmail (the flow queries label:remittance; apply this label to incoming remittance emails using a Gmail filter)

NetSuite

You must have:

  • A NetSuite account with token-based authentication configured
  • A NetSuite user or role with access to invoice records, customer payment records, journal entry records, and the NetSuite SuiteBundle RESTlet
  • The internal ID of your NetSuite AR account (required in template settings after installation)
  • Internal IDs for any NetSuite deduction accounts you want to map by reason code (SHORTAGE, PRICING, DAMAGED, FREIGHT, TAX, RETURN, and PROMO)

Celigo AI credits

Step 4 (AI agent) uses Celigo AI credits. Confirm your integrator.io account has AI credits available before running the flow. To check, go to My Account > Subscription

SFTP output server

Step 9 writes result CSV files to an SFTP server. You must have:

  • An SFTP host, username, and credentials
  • A directory path where the flow has write access

Install the template

To install the template:

  1. Sign in to integrator.io.
  2. Go to Marketplace and search for Email Remittance Manager, or import the template ZIP from Settings
  3. Open the template and review its contents.
  4. Select Install now.
  5. Select Configure next to the Gmail connection and authenticate with your Gmail account credentials. For detailed setup steps, see Configure a Gmail connection.
  6. Select Configure next to the NetSuite connection and configure token-based authentication. For detailed setup steps, see Configure a NetSuite connection.
  7. Complete the installation.

After installation, the Email Remittance Manager flow appears in your integrator.io account. Do not enable or run the flow until you complete the post-install steps in this article.

Set up the exception gate

The exception gate (step 6) routes records that don't meet confidence or matching thresholds to integrator.io error management. The gate calls an API endpoint that you must create after installing the template.

To set up the exception gate:

  1. In integrator.io, go to Resources > APIs
  2. Open or create the Remittance exception gate API. 
  3. Generate an API token for this API.
  4. Copy the API token.
  5. In the Email Remittance Manager flow, open the ERM - Categorize & route exceptions (gate) import step.
  6. Open the connection used by this step.
  7. Enter the API token you copied in step 4 above.
  8. Select Save.

After completing this setup, exception records are routed to integrator.io error management, where you can review the full extraction and matching analysis, edit the retry data, and resubmit.

Configure the FTP output connection

Step 9 writes the result CSV to an SFTP server. The template ZIP ships with a test FTP connection pointing at a public test server. Replace it with your own SFTP connection before running the flow in production. For detailed setup steps, see Set up an FTP connection.

Configure template settings

The template settings control the AR data source, matching behavior, tolerance thresholds, and deduction account mapping. Configure these settings after you've set up your connections and the exception gate.

To open template settings, go to the Email Remittance Manager template and select Settings

General settings

Setting Default Description
AR data source (arSource) netsuite Controls where the matching engine gets open invoice data. netsuite fetches live data from NetSuite on each run (production mode). cache matches against the arSnapshot list in settings (use for testing only).
Auto-post confidence threshold (autoPostConfidence) 0.9 Minimum AI confidence score (0 to 1) required to auto-post a record. Records below this threshold are sent to the exception gate instead.
Name match threshold (nameMatchThreshold) 0.75 Minimum token similarity score (0 to 1) for name-based customer matching. Lower values match more customers at the cost of accuracy.
Amount tolerance (%) (amountTolerancePct) 2 Percentage variance within which a payment is treated as full pay.
Amount tolerance (absolute) (amountToleranceAbs) 1 Dollar amount within which a payment is treated as full pay.
Maximum discount (%) (discountMaxPct) 3 Maximum discount percentage recognized as an earned terms discount (DISCOUNT_TERMS). Payments with a larger gap are coded as deductions.
Discount window (days) (discountWindowDays) 30 Number of days from the invoice date within which an early-pay discount is recognized as DISCOUNT_TERMS.
AR account ID (arAccountId) 6 NetSuite internal ID of your AR account. Update this before running the flow. The default value is from the staging environment and will not match your NetSuite account.
Currency (currency) USD Currency for payment and journal records.

Deduction accounts

Map each deduction reason code to the internal ID of the corresponding NetSuite account. Leave a field blank if you don't use that reason code.

Reason code Default Description
SHORTAGE 58 NetSuite account ID for shortage deductions.
PRICING (blank) NetSuite account ID for pricing deductions.
DAMAGED (blank) NetSuite account ID for damaged-goods deductions.
     
FREIGHT (blank) NetSuite account ID for freight deductions.
TAX (blank) NetSuite account ID for tax deductions.
RETURN (blank) NetSuite account ID for return deductions.
PROMO (blank) NetSuite account ID for promotional deductions.

Note: The SHORTAGE account defaults to 58 from the staging environment. Update all account IDs to match your NetSuite chart of accounts before running the flow.

Reason keywords

The matching engine classifies deductions by scanning AI-extracted reason text for keywords. Keywords are matched case-insensitively. You can extend the default keyword lists for each reason code in the reasonKeywords settings object.

Reason code Default keywords
SHORTAGE SHORT, SHORTAGE, MISSING, QTY, QUANTITY, UNITS NOT RECEIVED
PRICING PRICE, PRICING, OVERCHARGE, RATE, COST DIFF, UNIT COST
DAMAGED DAMAGE, DAMAGED, DEFECT, BROKEN, QUALITY
FREIGHT FREIGHT, SHIPPING, CARRIER, DELIVERY CHARGE
TAX TAX, GST, VAT, SALES TAX
RETURN RETURN, RTV, RMA, CREDIT MEMO, CM
PROMO PROMO, PROMOTION, REBATE, ALLOWANCE, CO-OP, MDF, ADVERTISING
DISCOUNT_TERMS EARLY PAY, PROMPT PAY, TERMS DISCOUNT, 2/10, 1/10, CASH DISCOUNT

AR snapshot (cache mode only)

When arSource is set to cache, the matching engine matches payments against the arSnapshot list in settings instead of querying NetSuite. Use this mode for testing only.

The template ships with sample arSnapshot data. Replace it with your own invoice records before testing. Each record requires the following fields: invoiceNumber, internalId, customerId, customerName, amountRemaining, and dueDate.

Output CSV

After each run, the template writes a result file named EMAILREMIT_RESULTS_<timestamp>.csv to the configured SFTP directory. Each row corresponds to one email processed in the run.

Column Description
Message ID Gmail message ID of the source email
Remitter Sender name extracted from the email
Identified Customer NetSuite customer name matched to this remittance
Customer ID NetSuite internal ID of the matched customer
Identification Method Method used to identify the customer (invoice match, alias, or name similarity)
Payment Ref Payment reference number from the remittance
Payment Date Payment date from the remittance
Payment Amount Total payment amount
Invoices Invoice numbers listed in the remittance
Matched Invoice numbers successfully matched to open NetSuite invoices
Discounts Earned Discount amounts recognized as DISCOUNT_TERMS
Deductions Deduction amounts and reason codes
Status APPLIED, PARTIALLY_APPLIED, UNAPPLIED, or UNIDENTIFIED
Category SUCCESS or EXCEPTION
Exceptions Exception codes for records routed to error management

Exception handling

Records that can't be processed automatically are routed to integrator.io error management through the exception gate (step 6). Each error record includes the full AI extraction output, matching analysis, and the exception code explaining why it was routed.

To resolve an exception:

  1. Go to the Error Dashboard in integrator.io. 
  2. Open the error for the Email Remittance Manager flow.
  3. Review the error details, including the extracted remittance data and the exception code.
  4. Edit the retry data if needed (for example, to override the customer match or link invoices by their NetSuite internal ID).
  5. Select Retry.

The following exception codes appear in error records and in the Exceptions column of the output CSV:

Exception code Meaning
NOT_REMITTANCE The AI agent determined the email is not remittance advice.
LOW_CONFIDENCE The AI extraction confidence score is below the autoPostConfidence threshold.
CUSTOMER_CONFLICT Invoice numbers in the remittance resolved to more than one NetSuite customer.
UNIDENTIFIED No NetSuite customer matched the remittance.
INVOICE_UNMATCHED The customer was identified, but no open invoices matched.
DEDUCTION_UNCODED A deduction was detected, but no reason keyword matched.
OVERPAYMENT The payment amount exceeds the total of matched invoices beyond the tolerance.
LINE_TOTAL_MISMATCH Line-item totals don't reconcile with the payment amount.
CROSS_CUSTOMER_INVOICE An invoice in the remittance belongs to a different NetSuite customer.

For more information on editing and retrying errors, see Error management in integrator.io.