Overview
Unqualified Data Types (UDT) are the foundation of UBL 2.1 type system. These types extend Core Component Types (CCT) and provide concrete implementations for common business data elements. All UDT types are in the namespaceurn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2.
Type Hierarchy
UDT types inherit from CCT types, which in turn inherit from XML Schema simple types:Text and String Types
UdtText
A character string, generally in the form of words of a language.The text content
CctTextType → XsdString
UdtName
A character string that constitutes the distinctive designation of a person, place, thing or concept.The name content
CctTextType → XsdString
Identifier Types
UdtIdentifier
A character string to identify and uniquely distinguish one instance of an object in an identification scheme from all other objects in the same scheme.The identifier value
Optional attributes
The identification scheme (e.g., “GLN”, “DUNS”)
The name of the identification scheme
The ID of the agency maintaining the scheme
The name of the agency maintaining the scheme
The version of the identification scheme
URI where the scheme data is located
URI where the scheme is located
CctIdentifierType → XsdNormalizedString
Code Types
UdtCode
A character string (letters, figures, or symbols) that for brevity and/or language independence may be used to represent or replace a definitive value or text of an attribute.The code value
Optional attributes
The identification of the code list
The agency maintaining the code list
The name of the agency
The name of the code list
The version of the code list
The textual equivalent of the code
The language identifier
URI where the code list is located
URI where the code list scheme is located
CctCodeType → XsdNormalizedString
Numeric Types
UdtNumeric
Numeric information that is assigned or determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.The numeric value as a string
Optional attributes
Whether the number is an integer, decimal, real number, or percentage
CctNumericType → XsdDecimal
UdtPercent
A numeric type specifically for percentage values.The percentage value
CctNumericType → XsdDecimal
UdtRate
A numeric rate value.The rate value
CctNumericType → XsdDecimal
UdtValue
A numeric value type.The value
CctNumericType → XsdDecimal
Monetary and Quantity Types
UdtAmount
A number of monetary units specified using a given unit of currency.The amount value
CctAmountType → XsdDecimal
The
currencyID should follow ISO 4217 currency codes (e.g., USD, EUR, GBP).UdtQuantity
A counted number of non-monetary units, possibly including a fractional part.The quantity value
CctQuantityType → XsdDecimal
UdtMeasure
A numeric value determined by measuring an object using a specified unit of measure.The measurement value
CctMeasureType → XsdDecimal
Unlike
UdtQuantity, UdtMeasure requires the unitCode attribute to be specified.Date and Time Types
UdtDate
A particular point in the progression of time, together with relevant supplementary information.The date in ISO 8601 format (e.g., “2024-03-15”)
XsdDate
UdtTime
An instance of time that occurs every day.The time in ISO 8601 format (e.g., “14:30:00”)
XsdDate
UdtDateTime
A particular point in the progression of time, combining date and time.The datetime in ISO 8601 format (e.g., “2024-03-15T14:30:00”)
XsdDate
Boolean Type
UdtIndicator
A list of two mutually exclusive boolean values that express the only possible states of a property.The boolean value (“true”/“false” or true/false)
XsdBoolean
Methods:
parseToJson(): Returns the indicator in JSON format with#textproperty
Binary Data Type
UdtBinaryObject
A set of finite-length sequences of binary octets.The binary data (typically base64 encoded)
Attributes for the binary object (mimeCode is required)
The format of the binary content
The MIME type (e.g., “application/pdf”, “image/png”)
The decoding algorithm (e.g., “base64”)
The character set if mime type is text
URI where the binary object is located
The filename of the binary object
CctBinaryObjectType → XsdNormalizedString
Common Patterns
Importing Types
Type Attributes
All attribute types are also exported and can be used for type safety:Method Chaining
Some types support method chaining for setting attributes:JSON Serialization
Most types provide aparseToJson() method:
Related Documentation
CCT Types
Core Component Types that UDT types extend
Invoice Builder
Using UDT types in invoice documents
References
- UBL 2.1 Specification
- Datypic UBL 2.1 Reference
- UBL Schema:
common/UBL-UnqualifiedDataTypes-2.1.xsd - Namespace:
urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2