AI invoice processing into Dynamics 365: staging, keys and review

Your AI pipeline reads invoices. Getting that data into Dynamics 365 safely means stable keys, staging, master-data checks and a person reviewing exceptions.

Westerwick5 min read

A thick stack of paper invoices and receipts, seen close up
Photo: Camilo Rueda Lopez on Unsplash (Unsplash License)
On this page

Reading an invoice with AI is now the easy part. The hard part is what happens next: getting that data into Dynamics 365 without paying a supplier twice, creating a duplicate vendor or posting to the wrong account. AI invoice processing into Dynamics 365 is mostly an integration problem, not a model problem.

This article covers the four things that make it safe: a reliable way in, a stable key, a staging step and a person who reviews the exceptions.

What the AI step gives you

A document pipeline on AWS turns a PDF or scan into structured fields. Amazon Textract, for example, "extracts relevant data such as vendor and receiver contact information, from almost any invoice or receipt without the need for any templates or configuration"1. It maps different labels ("bill number", "invoice number", "receipt number") to one standard field, INVOICE_RECEIPT_ID1.

Crucially, each value comes with "the confidence score associated with each piece of data detected on the document"1. That score is the start of your safety net, not the end of it. Our guide to Textract and Bedrock for document intake covers this step in more detail.

Three ways into Dynamics 365

Which door you use depends on which Dynamics product you run:

  • Dynamics 365 Finance and Operations has a data management framework built for bulk imports. By default, it "creates a staging table for each entity in the target database", and "staging tables let you verify, clean up, or convert data before you move it"4.
  • Business Central offers standard REST APIs for "Connect apps", which "establish a point-to-point connection between Dynamics 365 Business Central and a third party solution or service"5.
  • Dataverse, the data platform under Dynamics 365 Sales, Customer Service and Power Apps, has a Web API and low-code options through Power Automate36.

Don't pay an invoice twice: use a stable key

Pipelines retry. Networks drop. Someone re-uploads the same PDF. Your integration has to be idempotent: running it twice must produce the same result as running it once.

Dataverse is designed for this. Microsoft explains that when loading from an external system, "you might not know if a record already exists", and the Upsert operation creates the record if it's new and updates it if it isn't3. For this, "it's generally expected that you'll use alternate keys"3, a business identifier such as supplier number plus invoice number, rather than an internal ID.

Two practical notes:

  • Choose the key carefully. Supplier plus invoice number usually works. Invoice number alone doesn't, because two suppliers can use the same number.
  • Upsert has a cost. "There's a performance penalty when you use Upsert instead of Create. If you're sure the record doesn't exist, use Create"3.

An AI pipeline that can't be safely run twice will eventually run twice.

Stage first, post later

Never let AI output go straight into posted transactions. Land it somewhere it can be checked first.

Finance and Operations builds this in. Microsoft's documented process is to validate the mapping, verify security, run the job, "validate that the job ran as expected by reviewing the job history", and clean up the staging tables4. Microsoft even gives the invoice example: an organisation "that imports invoices by using data entities might provide a centralized invoice processing team that's responsible for managing invoice errors"4.

On the AWS side, AWS describes the same principle for its document pipelines. Validation rules support "numeric ranges, date formats, string patterns, and cross-field checks", so the system can "trigger human reviews when needed" and make sure data "meets specific business rules and compliance requirements before entering downstream systems"2. AWS also notes that "low confidence scores can signal the need for additional human review or verification of specific data fields"2.

In practice, we'd route an invoice to a person when:

  • any required field has low confidence
  • the totals don't add up (subtotal plus VAT should equal the total)
  • the supplier's bank details differ from those on file
  • the invoice key already exists

Check the data against what Dynamics already knows

A clean-looking supplier name on an invoice doesn't mean that supplier exists in your ERP. Matching extracted values to real master data is integration logic you own, and it's where most errors hide:

  • Vendors. Match on VAT number or supplier code, not name alone. Send unmatched invoices to review rather than creating new vendors automatically.
  • Accounts and cost centres. Map from purchase-order lines or supplier defaults where possible, instead of letting a model guess.
  • Master-data imports need care. Some Finance and Operations entities, "such as Vendors V2", don't support parallel import, and the task count must be 14.

The low-code option: Power Automate

For modest volumes on Dataverse, Power Automate can be enough. Its "Update a row" action can perform "an update or insert (upsert) operation"6. It's a sensible way to prove the flow. For high volumes, strict validation or Finance and Operations postings, a coded integration with proper staging is more dependable.

A note for South African teams

The AI step and your Dynamics environment may run in different places. Amazon Textract isn't listed for the AWS Africa (Cape Town) Region7, so invoice images are often processed abroad. That's a POPIA question worth settling with your privacy adviser before go-live. Our guide to document intake covers the options.

What to do next

  1. Define the key for each record type (for example supplier code plus invoice number) and add it as an alternate key where needed.
  2. Land everything in staging first, whether Finance and Operations staging tables or your own review queue.
  3. Write the exception rules: low confidence, totals that don't add up, changed bank details, duplicates and unmatched vendors.
  4. Name the reviewers and give them a screen showing the original document next to the extracted fields.
  5. Pilot on one supplier group with posting switched off, and compare the results against what your team captured by hand.

Our Read demo shows the review step in miniature: fields extracted from an invoice, checked against business rules, and routed on only after a person approves.

See it on your own data first.

We stand up a working proof of concept on our AWS account. Real sample data, no cost to you, before you commit to a build.