---
id: object/codeunit/30473-ca
type: object
title: Codeunit 30473 "Shpfy TMA Events" (CA)
summary: Codeunit 30473 "Shpfy TMA Events" (CA) in the CA country layer (Microsoft.Integration.Shopify). 4 public procedures, 3 event subscribers. 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: 9052eefc4ad2ec0327c5c5921dc6425a9a1eb1a60b4cf3ff18177a7c5744691c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/NA/ShopifyNA/app/src/Tax%20Matching%20Agent/Codeunits/ShpfyTMAEvents.Codeunit.al
    title: src/Apps/NA/ShopifyNA/app/src/Tax Matching Agent/Codeunits/ShpfyTMAEvents.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: 30473
name: Shpfy TMA Events
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: 7
  events: 0
  subscribers: 3
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 30473 "Shpfy TMA Events" (CA)

> Codeunit 30473 "Shpfy TMA Events" (CA) in the CA country layer (Microsoft.Integration.Shopify). 4 public procedures, 3 event subscribers. 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/ShpfyTMAEvents.Codeunit.al) · facts from BC29

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

## Properties

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

## Event subscriptions

- OnAfterMapShopifyOrder subscribes to Codeunit "Shpfy Order Events" OnAfterMapShopifyOrder
- OnBeforeCreateSalesHeaderSubscriber subscribes to Codeunit "Shpfy Order Events" OnBeforeCreateSalesHeader
- OnAfterCreateSalesHeaderSubscriber subscribes to Codeunit "Shpfy Order Events" OnAfterCreateSalesHeader

## Procedures

- `ShouldAttemptMatch(ShopifyOrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"): Boolean` (internal): Business guards deciding whether Shopify Tax Matching should run for an order: the shop must have the feature enabled, ship to the US or Canada, not already have a Tax Area (idempotency — e.g. address-based MapTaxArea already resolved one, or this is a re-import), and not be tax exempt. Capability-r...
- `IsSalesDocumentCreationHeld(ShopifyOrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"): Boolean` (internal): Decides whether Sales Document creation must be held for a agent-matched order. Held when the order was matched, is not yet approved, and either the shop's review mode requires it (see IsHeldForReviewPreference), the order carries a rate conflict, or the match is incomplete (one or more tax lines un...
- `IsHeldForReviewPreference(ShopifyOrderHeader: Record "Shpfy Order Header"; Shop: Record "Shpfy Shop"): Boolean` (internal): Evaluates only the shop's review-mode preference for an order (independent of the hard rate-conflict / incomplete gates and of the Applied/Reviewed markers). Always holds; Never does not; Low Confidence Only holds when the order carries at least one non-high-confidence match (Tax Match Low Confidenc...
- `HandleSalesHeaderCreated(OrderHeader: Record "Shpfy Order Header"; var SalesHeader: Record "Sales Header")` (internal): Propagates the Tax Match Applied marker from the originating Shopify Order Header onto the BC Sales Header. Exposed as internal so tests can drive the propagation without going through the connector's CreateHeaderFromShopifyOrder path. The Sales Order review prompt is derived live from this marker p...

## 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 Events")`, 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.
