languages

languages.find

Returns all the languages of the site.

JS
CR.api('site.languages.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.languages.find

request

{
  "fields" : [ "code", "name", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "languages" : [ { // languages
    "code" : "de", // code (ISO) - string(2)
    "name" : "Deutsch (German)", // name - string(1…35)
    "region" : "DE", // region (ISO code) - string(2)
    "currency" : "EUR", // currency (ISO code) - string(3)
    "isActive" : true, // indicates if it is showed on the site - bool
    "isDefault" : true // indicates if it is the dafult language - bool
  }, … ]
}

languages.create

Creates a new language for the site.

JS
CR.api('site.languages.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.languages.create

request

{
  "language" : { // language to create (required)
    "code" : "de", // code (ISO) (required) - string(2)
    "region" : "DE", // region (ISO code) (required) - string(2)
    "currency" : "EUR", // currency (ISO code) - string(3)
    "isActive" : true // indicates if it is showed on the site - bool
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
code InvalidValue Language '<code>' is not a valid language
code AlreadyExist Code '<code>' already exists
language LimitReached Maximum number of languages has been reached
region InvalidValue Region '<region>' is not a valid region
currency InvalidValue Currency '<currency>' is not a valid currency

languages.update

Updates a language. Any fields left out of the request will remain unchanged.

JS
CR.api('site.languages.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.languages.update

request

{
  "code" : "de", // code (ISO) of the language to update (required) - string(2)
  "language" : { // language's fields to update (required)
    "code" : "en", // new code (ISO) - string(2)
    "region" : "UK", // region (ISO code) - string(2)
    "currency" : "GBP", // default currency (ISO code) - string(3)
    "isActive" : true // indicates if it is showed on the site - bool
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
code InvalidValue Language '<code>' is not a valid language
code NotFound Language '<code>' does not exist
region InvalidValue Region '<region>' is not a valid region
currency InvalidValue Currency '<currency>' is not a valid currency
isActive InvalidValue 'isActive' can not be set to false for the default language

languages.delete

Deletes one or more languages from the site. The first language can not be deleted.

JS
CR.api('site.languages.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.languages.delete

request

{
  "codes" : [ "de", "en", … ] // codes (ISO) of the languages to delete (required) - string(2)
}

response

{
  "status" : "ok"
}

Available languages

The following languages are supported::

Code Name Region
bg български (Bulgarian)
BG
България (Bulgaria)
ca Català (Catalan)
ES
Català (Catalan)
cs Čeština (Czech)
CZ
Česká republika (Czech Republic)
da Dansk (Danish)
DK
Danmark (Denmark)
de Deutsch (German)
AT
Österreich (Austria)
CH
Schweiz (Switzerland)
DE
Deutschland (Germany)
LI
Liechtenstein (Liechtenstein)
LU
Luxemburg (Luxembourg)
el Ελληνικά (Greek)
GR
Ελλάδα (Greece)
en English (English)
AU
Australia (Australia)
CA
Canada (Canada)
GB
United Kingdom (United Kingdom)
IE
Eire (Ireland)
NZ
New Zealand (New Zealand)
US
United States (United States)
ZA
South Africa (South Africa)
es Español (Spanish)
AR
Argentina (Argentina)
CL
Chile (Chile)
CO
Colombia (Colombia)
CR
Costa Rica (Costa Rica)
DO
República Dominicana (Dominican Republic)
EC
Ecuador (Ecuador)
ES
España (Spain)
GT
Guatemala (Guatemala)
HN
Honduras (Honduras)
MX
México (Mexico)
NI
Nicaragua (Nicaragua)
PA
Panamá (Panama)
PE
Perú (Peru)
PR
Puerto Rico (Puerto Rico)
PY
Paraguay (Paraguay)
SV
El Salvador (El Salvador)
UY
Uruguay (Uruguay)
VE
Republica Bolivariana de Venezuela (Venezuela)
et Eesti (Estonian)
EE
Eesti (Estonia)
fi Suomi (Finnish)
FI
Suomi (Finland)
fr Français (French)
BE
Belgique (Belgium)
CA
Canada (Canada)
CH
Suisse (Switzerland)
FR
France (France)
LU
Luxembourg (Luxembourg)
MC
Principauté de Monaco (Principality of Monaco)
gl Galego (Galician)
ES
Galego (Galician)
hr Hrvatski (Croatian)
BA
Bosna i Hercegovina (Bosnia and Herzegovina)
HR
Hrvatska (Croatia)
hu Magyar (Hungarian)
HU
Magyarország (Hungary)
is Íslenska (Icelandic)
IS
Ísland (Iceland)
it Italiano (Italian)
CH
Svizzera (Switzerland)
IT
Italia (Italy)
SM
San Marino (San Marino)
lv Latviešu (Latvian)
LV
Latvija (Latvia)
mt Malti (Maltese)
MT
Malta (Malta)
nb Norsk, bokmål (Norwegian, Bokmål)
NO
Norge (Norway)
nl Nederlands (Dutch)
BE
België (Belgium)
NL
Nederland (Netherlands)
pl Polski (Polish)
PL
Polska (Poland)
pt Português (Portuguese)
BR
Brasil (Brazil)
PT
Portugal (Portugal)
ro Română (Romanian)
RO
România (Romania)
sk Slovenčina (Slovak)
SK
Slovenská republika (Slovakia)
sl Slovenski (Slovenian)
SI
Slovenija (Slovenia)
sq Shqipe (Albanian)
AL
Shqipëria (Albania)
sv Svenska (Swedish)
FI
Finland (Finland)
SE
Sverige (Sweden)
uk Україньска (Ukrainian)
UA
Україна (Ukraine)