Moloni ON Logo WhiteGuidesAPI ReferenceExplorer
Guides

Translated Fields

Several resources in the Moloni ON API (document types, countries, currencies, and languages) store their names and descriptions in multiple languages. These resources expose a translations array with one entry per language, and a set of shorthand fields that return the translation for a specific language directly.

How it works

Resources with translated content follow this pattern:

  • A translations array holds every available translation (one entry per language, each with a languageId).
  • Shorthand fields like title, titlePlural, name, description, notes, and abbreviation are convenience aliases that return the value for the language specified in options.defaultLanguageId.
  • If defaultLanguageId is omitted, the shorthand fields return null.

Fetching available languages

Use the languages query to get all supported language IDs:

query {
  languages {
    data {
      languageId
      name
      iso3166
    }
  }
}

Common language IDs:

languageIdLanguage
1Portuguese (PT)
2English

Using defaultLanguageId

Pass defaultLanguageId inside the options argument of any query that supports it:

query {
  documentTypes(options: { defaultLanguageId: 2 }) {
    data {
      documentTypeId
      apiCode
      title       # English name, e.g. "Invoice"
      titlePlural # English plural, e.g. "Invoices"
    }
  }
}

Without defaultLanguageId, title and titlePlural are null. To always get a name regardless of language preference, query the full translations array instead:

query {
  documentTypes {
    data {
      documentTypeId
      apiCode
      translations {
        languageId
        title
        titlePlural
      }
    }
  }
}

Resources that support translated fields

ResourceShorthand fields
Document Typestitle, titlePlural
Countriestitle, notes
Currenciesdescription, abbreviation
Languagesname

All of these accept defaultLanguageId in their options argument and expose a translations array for the full data.

Next steps

  • Document Types: Use translated document type names in your app
  • Customers: Work with country and currency references on customer records
  • API Reference: Explore all types with translatable fields

© 2026 Moloni ON

Tax Authority Certificate No. 3075