StorefrontTranslation
Private Storefront Translation API endpoints
- GET/shop/translations
- POST/shop/translations
- GET/shop/translations/{translation_id}
- PATCH/shop/translations/{translation_id}
- DELETE/shop/translations/{translation_id}
- POST/shop/translations/{translation_id}/publish
- POST/shop/translations/{translation_id}/unpublish
- POST/shop/translations/{translation_id}/primary
- GET/shop/translations/{translation_id}/texts
- PATCH/shop/translations/{translation_id}/texts
A page of the shop's storefront translations, the languages checkout and the customer portal can be shown in, unpublished ones included, oldest first.
Query parameters
pageoptionalintegerPage number
Defaults to 1.
per_pageoptionalintegerItems per page
Defaults to 50.
Returnsobject
Storefront translations list response
Error responses
422objectpage is not an integer of at least 1, or per_page is not an integer from 1 to 500.
Add a language checkout and the customer portal can be shown in. It starts unpublished, so customers cannot pick it until it is published. Send template to start it with a full set of texts; without one it has no texts and customers see the built-in English.
Request body
nameRequiredstringThe name customers see for it in the language switcher. It cannot contain emoji or other characters beyond U+FFFF.
codeRequiredstringA two-letter ISO 639-1 language code, in any letter case, returned in lower case. The shop cannot already have a translation with this code.
currency_symbol_positionoptionalstring | nullWhether the currency symbol is shown before ("$10") or after ("10 $") amounts. Leave it out or send null for the template's position, or before without a template.
Possible values: before, after.
templateoptionalstring | nullStart the translation with every text of a template: en English, es Spanish, fr French or nl Dutch. English puts the currency symbol before amounts, the others after. Leave it out or send null to start with no texts.
Possible values: en, es, fr, nl.
ReturnsStorefrontTranslation
The added storefront translation
Error responses
400objectStorefront translations are not available for the shop, or template is sent and custom translation texts are not available for it (feature_not_available).
422objectValidation failed: name is missing, longer than 255 characters or contains emoji; code is missing, is not an ISO 639-1 code or is a language the shop already has a translation for; or currency_symbol_position or template is not one of its values.
One of the shop's storefront translations, published or not.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslation
Storefront translation object response
Error responses
404objectThe translation does not exist or belongs to another shop.
Rename a storefront translation or change its code or currency symbol position: send only the keys you want to change; every other value stays as it is. Its texts are kept.
Path parameters
translation_idRequiredintegerStorefront translation ID
Request body
nameoptionalstringThe name customers see for it in the language switcher. It cannot be null or contain emoji or other characters beyond U+FFFF.
codeoptionalstringA two-letter ISO 639-1 language code, in any letter case, returned in lower case. It cannot be null, and no other translation of the shop can have it; resending the translation's own code passes.
currency_symbol_positionoptionalstringWhether the currency symbol is shown before ("$10") or after ("10 $") amounts. It cannot be null.
Possible values: before, after.
ReturnsStorefrontTranslation
The updated storefront translation
Error responses
400objectStorefront translations are not available for the shop (feature_not_available).
404objectThe translation does not exist or belongs to another shop.
422objectValidation failed: a sent key is null; name is longer than 255 characters or contains emoji; code is not an ISO 639-1 code or is a language another translation of the shop has; or currency_symbol_position is not one of its values.
Remove a storefront translation and its texts, and return it as it was. Customers can no longer pick it, and it is gone from the list. When it is the primary translation, the shop then has no primary translation, and checkout shows the published translation the customer asks for, else the first published one.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslation
The removed storefront translation, serialised as it was just before the removal.
Error responses
404objectThe translation does not exist or belongs to another shop.
Let customers pick a storefront translation in checkout and the customer portal. When the shop has no primary translation, this one becomes it. Publishing a translation that is already published changes nothing.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslation
The published storefront translation
Error responses
400objectStorefront translations are not available for the shop (feature_not_available), or the shop already has as many published translations as it can have (translation_limit_reached).
404objectThe translation does not exist or belongs to another shop.
Stop customers picking a storefront translation. When it is the primary translation, the shop then has no primary translation, and checkout shows the published translation the customer asks for, else the first published one. Its texts stay, so it can be published again. Unpublishing a translation that is already unpublished changes nothing.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslation
The unpublished storefront translation
Error responses
404objectThe translation does not exist or belongs to another shop.
Make a published storefront translation the shop's primary translation, the one checkout and the customer portal show first. The previous primary translation stays published. Making the primary translation primary again changes nothing.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslation
The primary storefront translation
Error responses
400objectStorefront translations are not available for the shop (feature_not_available), or the translation is not published (translation_not_published).
404objectThe translation does not exist or belongs to another shop.
The texts checkout and the customer portal show in this translation, as plain text: every key of every section, with null where the translation sets no text of its own.
Path parameters
translation_idRequiredintegerStorefront translation ID
ReturnsStorefrontTranslationTexts
Storefront translation texts response
Error responses
404objectThe translation does not exist or belongs to another shop.
Change a storefront translation's texts: send only the sections and keys to change, each as customers should see it, and every other text stays as it is. null removes the translation's own text, so customers see the built-in English one again. Leading and trailing spaces are removed, and emoji are not accepted. The reply lists every text, as GET does.
Path parameters
translation_idRequiredintegerStorefront translation ID
Request body
[key]optionalobjectThe section's texts by key.
ReturnsStorefrontTranslationTexts
Every text of the storefront translation, after the change
Error responses
400objectStorefront translations, or custom translation texts, are not available for the shop (feature_not_available).
404objectThe translation does not exist or belongs to another shop.
422objectValidation failed, on the text's path such as cart.addToCart: the section or key does not exist; a text is not a string of 1 to 1000 characters once leading and trailing spaces are removed (so a text of spaces only is refused), or contains emoji; a plural text is not a list of 1 to 3 such forms; a { or } is not around a placeholder name; or a text with @ or | also holds a placeholder, an apostrophe, a backslash or a line break.