HTTP Operation Type Object
(Action) localizedEnumValues

Description

The localizedEnumValues service allows you to retrieve the localized labels of enumeration values by providing the name of the enumeration and the target language.

This service is particularly useful to dynamically populate UI dropdowns or filters with proper localized labels.

The language parameter is mandatory and must be provided in one of the following formats:

  • Short format: fr, en, es, de.
  • Full format: as returned by applicationLanguageCode in userProfile, e.g., fr-FR.

The list of available enumeration names can be retrieved by querying the GraphQL schema. If necessary, an additional page listing all enums and their values could be considered.
Internally, the enums are defined in the schema_enum.graphql file, which is automatically generated.

img

Select an enumeration authorized by localized enum values

Required Parameters

To utilize this service, you must provide the following parameters:

Response

The service returns a list of objects containing both the value and its localized label.

Key Value
Authorization Bearer Current access Token How to find?
x-api-key Primary or secondary subscription key of your app How to find?
graphQL Query
query($enumName: String!, $language: String!) {
  localizedEnumValues(enumName: $enumName, language: $language) {
    value
    label
  }
}
graphQL Variables
{
  "enumName": "UnitOfMeasurementNameType",
  "language": "de"
}
Example Response
{
    "data": {
        "localizedEnumValues": [
            {
                "value": "CUBIC_METRE",
                "label": "Kubikmeter"
            },
            {
                "value": "DAY",
                "label": "Tag"
            },
            {
                "value": "GRAM",
                "label": "Gramm"
            },
            {
                "value": "HOUR",
                "label": "Stunde"
            },
            {
                "value": "KILOGRAM",
                "label": "Kilogramm"
            },
            {
                "value": "KILOMETRE",
                "label": "Kilometer"
            },
            {
                "value": "LITRE",
                "label": "Liter"
            },
            {
                "value": "METRE",
                "label": "Meter"
            },
            {
                "value": "MILLIGRAM",
                "label": "Milligramm"
            },
            {
                "value": "MILLILITRE",
                "label": "Milliliter"
            },
            {
                "value": "MONTH",
                "label": "Monat"
            },
            {
                "value": "NIGHT",
                "label": "Nacht"
            },
            {
                "value": "NOT_UNIT",
                "label": "Nicht angegeben"
            },
            {
                "value": "PACK",
                "label": "Packung"
            },
            {
                "value": "PERCENTAGE",
                "label": "Prozent"
            },
            {
                "value": "SQUARE_METRE",
                "label": "Quadratmeter"
            },
            {
                "value": "TONNE",
                "label": "Tonne"
            },
            {
                "value": "UNIT",
                "label": "Stück"
            }
        ]
    }
}

Error Handling

If the enum name or the language is unsupported or invalid, the API responds with informative messages:

{
  "errors": [
    {
      "message": "Unrecognized enumeration name 'AccountsLevel'. Please check the enumeration name and try again."
    }
  ],
  "data": null
}
{
  "errors": [
    {
      "message": "The specified language 'XX' is unsupported."
    }
  ],
  "data": null
}

localizedEnumValues Input parameters

Fields Type Description Length
enumName String The name of the enumeration to localize 250
language String Required language code 2 or 5
Info
  • enumName: The technical name of the enum, e.g., ProductCategory, SalesDocumentType, etc.
  • language: The language in which labels are returned.
    Must be in short format (fr, en, es, de) or full format (fr-FR).

localizedEnumValues Response

Fields Type Description
value String Enum value (technical name)
label String Localized label for the enum value