Language

An object representing a language for the current shop.

Properties

Property Description
uid The unique identifier of the language as an IETF language code.
active Whether the language is visible to shop visitors. This property is accessible to administrators only.
defaultCurrency The default currency to be shown when the language is selected.

Methods

count

Takes a filter object and returns the number of languages found, as an integer.

Parameters

A filter object specifying which languages to count. See Filter objects on the page List selection.

Example

The request below returns the number of active languages.

API Console
Language.count(
  {
    "/active": true
  }
)
Response
3

get

Fetches information about a language.

Parameters

Parameter Description
uid The unique identifier of the language.
query Which info to return. See Query language.

Example

API Console
Language.get("en")
Response
{
  "uid": "en",
  "active": true,
  "defaultCurrency": "SEK",
}

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

The unique identifier of the language.

list

Returns an array of objects representing languages.

Parameters

Parameter Description
query Which info to return. See Query language.
selection Which languages to list. See List selection.