---
id: object/codeunit/30471-ca
type: object
title: Codeunit 30471 "Shpfy TMA Matcher" (CA)
summary: Codeunit 30471 "Shpfy TMA Matcher" (CA) in the CA country layer (Microsoft.Integration.Shopify). 11 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - ca layer
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 696272624513d5780ad67c56d56c8f5bfa682ef7d28cab5e6133f7e29b1613ac
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/NA/ShopifyNA/app/src/Tax%20Matching%20Agent/Codeunits/ShpfyTMAMatcher.Codeunit.al
    title: src/Apps/NA/ShopifyNA/app/src/Tax Matching Agent/Codeunits/ShpfyTMAMatcher.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/ca
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11899
    - change/bcapps/11722
    - change/bcapps/10408
object_type: codeunit
object_id: 30471
name: Shpfy TMA Matcher
namespace: Microsoft.Integration.Shopify
app: ShopifyNA
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
country: CA
counts:
  fields: 0
  procedures: 41
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 30471 "Shpfy TMA Matcher" (CA)

> Codeunit 30471 "Shpfy TMA Matcher" (CA) in the CA country layer (Microsoft.Integration.Shopify). 11 public procedures. Introduced in BC29, still in BC30.

CA country layer · Microsoft.Integration.Shopify · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/NA/ShopifyNA/app/src/Tax%20Matching%20Agent/Codeunits/ShpfyTMAMatcher.Codeunit.al) · facts from BC29

An object of the [CA localization](../../localizations/ca.md), not part of W1.

## Properties

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

## Procedures

- `MatchTaxLines(var OrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"; SecurityPrompt: SecretText; var MatchedJurisdictions: List of [Code[10]]; var MatchLog: JsonArray; var HasRateConflict: Boolean; var HasUnresolvedLine: Boolean; var HasLowConfidenceMatch: Boolean): Boolean`
- `MatchTaxLinesWithoutProcessingLimit(var OrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"; SecurityPrompt: SecretText; var MatchedJurisdictions: List of [Code[10]]; var MatchLog: JsonArray; var HasRateConflict: Boolean; var HasUnresolvedLine: Boolean; var HasLowConfidenceMatch: Boolean): Boolean` (internal)
- `ResetMatchState(var OrderHeader: Record "Shpfy Order Header")` (internal)
- `ApplyMatches(var OrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"; MatchResults: JsonObject; UnmatchedTaxLineIds: List of [Text]; var MatchedJurisdictions: List of [Code[10]]; var MatchLog: JsonArray; var HasRateConflict: Boolean; var HasUnresolvedLine: Boolean; var HasLowConfidenceMatch: Boolean): Boolean` (internal): Applies the model's match results to the order's tax lines. Only the lines in UnmatchedTaxLineIds (the ones sent for matching) can be assigned. Internal so tests can apply a response without an LLM call.
- `ReapplyFromAssignedLines(var OrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"; var MatchedJurisdictions: List of [Code[10]]; var MatchLog: JsonArray; var HasRateConflict: Boolean): Boolean`: Re-applies the tax match from the jurisdiction codes currently assigned on the order's tax lines (e.g. after a human edited or completed them on the review page). Runs the same per-line seeding/conflict logic as the LLM path but takes the human's jurisdictions as given, then reports whether any assi...
- `UnverifyAgentJurisdictions(OrderHeader: Record "Shpfy Order Header")` (internal): Reverses the jurisdiction verification that an order's approval performed: for each agent-created jurisdiction the order used that is Verified, clears Verified so the jurisdiction returns to its provisional state (later matches to it are forced low confidence and held again). User-created or pre-exi...
- `TryGetEffectiveItemRate(OrderTaxLine: Record "Shpfy Order Tax Line"; var BCRate: Decimal): Boolean`: Returns the Business Central Tax Detail rate that would apply to a tax line's item, given the jurisdiction currently assigned to the line and the order's effective date. Used by the review page to show BC's rate next to Shopify's and highlight a difference. Returns false when no jurisdiction is assi...
- `SeedTaxDetailFromShopifyRate(OrderTaxLine: Record "Shpfy Order Tax Line"): Boolean`: Creates — or, when one already exists on the order's document date, updates — a Tax Detail for the tax line's Tax Jurisdiction and resolved tax group so Business Central posts the rate Shopify charged, effective the order's document date. This mutates shared BC tax setup: it is NOT scoped to a singl...
- `ResolveCanadianHSTJurisdictionCode(OrderHeader: Record "Shpfy Order Header"; SuggestedJurisdictionCode: Code[10]; AutoCreateTaxJurisdictions: Boolean): Code[10]` (internal)
- `TryGetGuardrailPrompt(var SecurityPrompt: SecretText): Boolean` (internal)
- `Capitalize(Confidence: Text): Text` (internal)

Plus 30 local procedures.

## Recent changes

- 2026-10-01 [#11899 [Shopify] Tax matching fixes for country, Canadian HST, and zero-rate lines](../../changes/bcapps/11899.md) (main, BC30, fix)
- 2026-09-29 [#11722 [Shopify] Rename tax matching and add configurable processing limit](../../changes/bcapps/11722.md) (main, BC30, feature)
- 2026-08-28 [#10408 Shopify Copilot Tax Matching Agent: matching engine and data model (stack 2/3)](../../changes/bcapps/10408.md) (main, BC30, feature, added)

## Across versions

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

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). 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: "Shpfy TMA Matcher")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

A CA country object, not part of W1: the default corpus does not have it; `bcatlas_list_countries` shows which countries the atlas has.
