Fiscalapi
Clave unidad: SAT unit of measure codes

Clave unidad: SAT unit of measure codes

May 10, 2026

Leer en español

The clave unidad SAT is the unit of measure code that the SAT (Mexico's tax authority, Servicio de Administración Tributaria) requires on every line item of a CFDI (Mexico's electronic invoice). It's one of those fields that look trivial until your PAC (Proveedor Autorizado de Certificación, a SAT-authorized provider that stamps CFDIs) refuses to stamp the CFDI (stamping: the certification by a SAT-authorized provider that makes a CFDI valid), or the SAT questions an invoice because something doesn't add up. The c_ClaveUnidad catalog has more than 2,400 keys based on the UN/CEFACT standard. Most integrators end up using the same three or four without realizing they're leaving cases uncovered or, worse, picking combinations that don't fit the ClaveProdServ (the SAT product or service key).

This guide covers the keys behind most of the CFDIs issued in Mexico, how to pair them correctly with the product key, and the mistakes that cause the most failures in production.

What clave unidad SAT means: the c_ClaveUnidad catalog

The clave unidad SAT (c_ClaveUnidad) is the official catalog that defines how each line item on a CFDI is quantified: pieces, kilograms, hours, services, liters, meters. It's a required field in the Concepto node, and it has to make sense alongside the ClaveProdServ of the same line item.

The keys follow the UN/CEFACT standard (United Nations Centre for Trade Facilitation and Electronic Business): codes of two or three alphanumeric characters that the SAT adopted with CFDI version 3.3. The reason for adopting an international standard was to align Mexican invoices with the customs and foreign trade catalogs. That also explains why the catalog is so large: it covers every unit you can think of, from the troy ounce to the kilowatt-hour.

How ClaveUnidad relates to ClaveProdServ

ClaveProdServ describes what you sold; ClaveUnidad describes how what you sold is measured. Both keys are required on every line item, and the SAT expects them to be consistent with each other. If you sell software or hardware engineering services (81111500), the sensible unit is E48 (Unidad de servicio, service unit) or ACT (Actividad, activity), not KGM (Kilogramo, kilogram). If the combination isn't coherent, the CFDI stamps, but it stays exposed to questions in a review.

The rule of thumb for pairing them correctly:

Type of line itemTypical ClaveProdServRecommended ClaveUnidad
Professional serviceDivisions 80, 81, 84E48 (Unidad de servicio, service unit)
Service charged by the hourDivisions 80, 81HUR (Hora, hour)
Countable physical productDivisions 10-60H87 (Pieza, piece)
Bulk goodsDivisions 10-60KGM (Kilogramo, kilogram)
LiquidsDivisions 10-60LTR (Litro, liter)
Monthly subscription81112105 (Servicios de hospedaje de operación de sitios web, website hosting)MON (Mes, month)
Transportation servicesDivision 78KMT (Kilómetro, kilometer) or E48
TrainingDivision 86HUR (Hora, hour) or E48

If you want to understand the logic behind ClaveProdServ before you pair it, the clave prod serv guide explains the UNSPSC structure (United Nations Standard Products and Services Code) and how to pick the right division for your business type.

Where ClaveUnidad lives in the CFDI 4.0 XML

The key is an attribute of the Concepto node, next to ClaveProdServ. Here's the node for a service charged by the hour:

<cfdi:Conceptos>
  <cfdi:Concepto
    ClaveProdServ="80101500"        <!-- Business consulting services -->
    Cantidad="20"
    ClaveUnidad="HUR"               <!-- Hour -->
    Unidad="Hora"                   <!-- Free text, optional -->
    Descripcion="Consultoría técnica - 20 horas mes mayo 2026"
    ValorUnitario="1500.00"
    Importe="30000.00"
    ObjetoImp="02">
    ...
  </cfdi:Concepto>
</cfdi:Conceptos>

Three things matter when the PAC validates this node:

ClaveUnidad must exist in the current version of the c_ClaveUnidad catalog. A withdrawn or misspelled key makes stamping fail.

The Unidad field (without "Clave") is optional free text. It shows the human reader the unit in their own language. If you set Unidad="Hora" with ClaveUnidad="HUR", the PDF can show both; if you only set ClaveUnidad, the PDF shows the key or its official catalog description, depending on the system that generates it.

Cantidad has to make sense with the unit. Selling 0.5 H87 (piece) is syntactically valid but odd: half a piece. For fractions, switching to KGM or LTR makes more sense, depending on the case.

If your system lets users type the "Unidad" text freely while it fills in ClaveUnidad automatically, check that the text reflects what the key means. Writing Pieza (piece) in the text when the ClaveUnidad is KGM confuses the recipient and opens the door to questions from the SAT.

The 30 most used SAT unit of measure codes

The full catalog has more than 2,400 keys, but these 30 cover nearly everything invoiced in Mexico. They're grouped by unit type so you can find one by context. The names are the SAT's own, in Spanish, as they appear in the catalog.

ClaveUnidadSAT nameWhen to use it
E48Unidad de servicio (service unit)Generic services (consulting, software, advisory)
ACTActividad (activity)Services billed per project or deliverable
HURHora (hour)Services charged by time
DAYDía (day)Daily rentals, lodging
MONMes (month)Monthly subscriptions, rent
ANNAño (year)Annual subscriptions, contracts
H87Pieza (piece)Countable physical products (the most common)
XBXCaja (box)Products sold by the box
XPKPaquete (package)Products sold in packages
KGMKilogramo (kilogram)Goods sold by weight
GRMGramo (gram)Small products sold by weight
MGMMiligramo (milligram)Substances and pharmaceutical products measured in milligrams
TNETonelada (tonelada métrica) (metric ton)Industrial cargo
LTRLitro (liter)Liquids in general
MLTMililitro (milliliter)Small quantities of liquid
GLLGalón (EUA) (US gallon)Fuels, industrial liquids
MTRMetro (meter)Linear materials (cable, fabric)
CMTCentímetro (centimeter)Short materials
MTKMetro cuadrado (square meter)Construction, land, carpeting
MTQMetro cúbico (cubic meter)Concrete, water, gas
KMTKilómetro (kilometer)Transportation by distance
KWHKilowatt hora (kilowatt-hour)Electricity
KWTKilowatt (kilowatt)Electrical capacity
BTUUnidad térmica británica (tabla internacional) (British thermal unit)Thermal capacity
XLTLote (lot)Products sold by the lot
E51Trabajo (job)Labor billed per job
E54Viaje (trip)Transportation services billed per trip
C62Uno (one)Single items; the SAT's suggested-keys PDF uses it for membership dues, tolls, and prepared food and drinks
XUNUnidad (unit)Generic, when nothing else fits
PRPar (pair)Products sold in pairs, such as shoes

For a key that isn't on this list, the units of measure section of Fiscalapi's SAT catalogs reference lists the units most used in e-invoicing, and the catalogs API looks up any key in the catalog.

E48 and H87 together cover most of the CFDIs issued in Mexico. If you sell services, the E48 unit code is the safe default. If you sell countable physical products, H87 is almost always the right choice.

XUN (Unidad, unit) looks like a catch-all, and that's the trap. It's meant for the rare case where the catalog has no suitable unit. Before you set XUN, look for a specific key. Using XUN out of convenience muddles your accounting reports and invites questions from the SAT in a review.

Common mistakes with the SAT unit of measure

These are the problems we see most often when this field gets filled in without much thought.

How to query the catalog programmatically

The c_ClaveUnidad catalog lives in the SAT's official XSD file, like most of the catalogs in Anexo 20 (the SAT technical standard that defines the CFDI: its XML structure, catalogs, and validation rules). For a production integration, keeping it in memory and syncing it by hand is unnecessary work.

Fiscalapi exposes c_ClaveUnidad through its REST API as SatUnitMeasurements, with a search by description and a lookup by key, on the same records the SAT publishes. The SAT catalogs documentation in Fiscalapi describes the search parameters and pagination. The catalog endpoints are available in the official SDKs for .NET, Node.js, Python, Java, and PHP, with usage examples on GitHub. That lets you build unit pickers with autocomplete in your UI without maintaining the catalog locally.

Frequently asked questions about the clave unidad SAT

The SAT unit of measure is a small field with big consequences when it's filled in without thought. If your integration still has H87 hardcoded on every line item, review your ClaveProdServ-ClaveUnidad combinations now, not after the SAT's first question.