---
id: object/codeunit/7438
type: object
title: Codeunit 7438 "EA Receipt Expense Match"
summary: Codeunit 7438 "EA Receipt Expense Match" in ExpenseAgent (Microsoft.ExpenseAgent). 3 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - expenseagent
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-12-06T00:48:06.827Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 303832c337b43a747ca6cf98ec6705a3e7ced981c0cbbf5a0f40a297bbb807cb
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/4e6a307ce8a2e8c5a28f8f0c4c2c7d561f4fe679/src/Apps/W1/ExpenseAgent/app/src/CorporateCard/Codeunits/EAReceiptExpenseMatch.Codeunit.al
    title: src/Apps/W1/ExpenseAgent/app/src/CorporateCard/Codeunits/EAReceiptExpenseMatch.Codeunit.al (releases/29.x)
    date: null
    commit: 4e6a307ce8a2e8c5a28f8f0c4c2c7d561f4fe679
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/14884
    - change/bcapps/14598
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/expense-management/expense-agent-upload-receipts
      title: Upload Receipts and Create Mileage Expenses
      label: possibly related
      why: Matches receipt images to expenses and handles receipt scanning extraction for Expense Agent
      by: model
object_type: codeunit
object_id: 7438
name: EA Receipt Expense Match
namespace: Microsoft.ExpenseAgent
app: ExpenseAgent
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 12
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 2
  implements: 0
---

# Codeunit 7438 "EA Receipt Expense Match"

> Codeunit 7438 "EA Receipt Expense Match" in ExpenseAgent (Microsoft.ExpenseAgent). 3 public procedures. Introduced in BC29, still in BC30.

ExpenseAgent · Microsoft.ExpenseAgent · BC29-30 · [source at 4e6a307c](https://github.com/microsoft/BCApps/blob/4e6a307ce8a2e8c5a28f8f0c4c2c7d561f4fe679/src/Apps/W1/ExpenseAgent/app/src/CorporateCard/Codeunits/EAReceiptExpenseMatch.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Procedures

- `FindMatchingExpense(ExpenseUserSystemId: Guid; ExpenseDate: Date; Amount: Decimal; CurrencyCode: Code[10]; MerchantName: Text[100]; CardLast4: Text): Guid` (internal): Returns the SystemId of the card expense that the receipt belongs to, or an empty GUID when none matches. Candidates must have the same expense user, currency and exact amount, and an expense date within the Corp Card Date Match Window. When CardLast4 is four digits, the expense must also be paid wi...
- `CheckMatchingExpense(ExpenseUserSystemId: Guid; ExpenseSystemId: Guid; ExpenseDate: Date; Amount: Decimal; CurrencyCode: Code[10]; CardLast4: Text): Guid` (internal): Returns ExpenseSystemId when that expense is a card expense the receipt belongs to, or an empty GUID otherwise. Uses the same rules as FindMatchingExpense, except the merchant name: the user picked the expense, so it is not checked.
- `IsWaitingForReceipt(Expense: Record Expense): Boolean` (internal): Returns true when a receipt can still be applied to the card expense: either the expense is not on an expense report yet and is open or released (for example after it was removed from a report), or it is on an open expense report and its line has no receipt and no lost-receipt declaration.

Plus 9 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 6988 "Expense API Currency Helper"](../codeunit/6988.md) (2 calls: `SetCurrencyFilter → GetCurrencyCodeForAPI`, `SetCurrencyFilter → GetCurrencyCodeFromAPI`)
- [Codeunit 7426 "EA Corp Card Enh. Match Mgt"](../codeunit/7426.md) (1 call: `GetMerchantSimilarity → CalculateSimilarity`)

## Called by

- [Page 7425 "EA Card Expense Matches API"](../page/7425.md) (2 calls: `OnInsertRecord → CheckMatchingExpense`, `OnInsertRecord → FindMatchingExpense`)
- [Codeunit 7450 "EA Card Receipt Data Apply"](../codeunit/7450.md) (1 call: `GetCardExpense → IsWaitingForReceipt`)

## Recent changes

- 2026-12-05 [#14884 [Expense Agent] Replace the receipt of a corporate card expense](../../changes/bcapps/14884.md) (main, BC30, feature)
- 2026-11-29 [#14598 [Expense Agent] Corporate card transactions as expense report lines](../../changes/bcapps/14598.md) (main, BC30, feature, added)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Upload Receipts and Create Mileage Expenses](https://learn.microsoft.com/dynamics365/business-central/expense-management/expense-agent-upload-receipts) — possibly related: Matches receipt images to expenses and handles receipt scanning extraction for Expense Agent (model-linked)

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "EA Receipt Expense Match")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
