> This page is for Documentation, version AI use cases.
> For other versions, use one of these documentation indexes:
> - Integration guides (default): https://avalara.ferndocs.com/docs/integration-guides/llms.txt
> - Refactor guides: https://avalara.ferndocs.com/docs/refactor-guides/llms.txt
> - Get certified: https://avalara.ferndocs.com/docs/get-certified/llms.txt
> - Agent to Agent (A2A): https://avalara.ferndocs.com/docs/agent-to-agent-a2a/llms.txt
> - AI use cases: https://avalara.ferndocs.com/docs/ai-use-cases/llms.txt
> - API versioning: https://avalara.ferndocs.com/docs/api-versioning/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://avalara.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://avalara.ferndocs.com/_mcp/server.

# Transaction matching

Understand how AvaTax matches transactions to your ERP using document codes and key transaction fields.

Transactions are matched between systems using the document code. In AvaTax, the primary matching field is the `code` field. The corresponding transaction identifier in the ERP varies by system and must be mapped to the AvaTax document code.

The following AvaTax fields are used during matching and discrepancy detection:

Field

Description

Purpose

`code`

Document code

Primary matching key

`date`

Transaction date

Period alignment

`totalAmount`

Pre-tax transaction total

Amount matching

`totalTax`

Calculated tax amount

Tax variance detection

`status`

Transaction status

Saved, Posted, Committed, Canceled

`type`

Document type

SalesInvoice, ReturnInvoice, and so on.

Accurate document code mapping is required to ensure that transactions are properly aligned between the ERP system and AvaTax.

Note

Reconciliation requires that transactions be saved in AvaTax as invoice-type documents, such as sales invoice or return invoice. Order transactions that are not saved as invoices in AvaTax aren’t included in reconciliation results.

> **Note**
>
> Part of the **AI-assisted tax reconciliation** AI use case. [Open the full "Transaction matching" section on Avalara](https://developer.avalara.com/transaction-reconciliation/hwr7665138978007/).