Theme API
Write CallUpdateShopStrings1
Change a shop's customer-facing strings and their translations, in one or more languages at once. Affects the shop's customer-facing pages at once.
| Kind | Write API call |
|---|---|
| Method | POST |
| URL | https://app.bubblehouse.com/api/v2023061/<shop>/UpdateShopStrings1 |
| Authentication | Shop TokenStaff Token |
Get keys, revision and the languages from ListShopStrings1 first. Any string can be changed, also one not listed as configured.
Each item sets string in the call's language (the base language when empty), and/or localized_strings by language. An empty string removes: a base override, so the default shows again, or a translation, so the base text shows.
The strings edit permission changes base texts and translations; the translate permission only translations. Base texts of tiers, rewards, ways to earn and similar (read_only_base) are changed where those are configured, with update_configuration; their translations are changed here. HTML texts need the custom code permission.
Before saving, the shop's configuration is built with the change in. If that adds configuration errors, nothing is saved and they are returned. dry_run runs the checks without saving; allow_new_errors saves anyway. Saves are recorded in the shop's settings history under your user.
Input
-
languagestring optionalThe language of each item's
string; empty means the base language. A translation language fromlanguages: a locale such asfr-FR, or a venue or market context such asstore:fr-FR. -
The strings to change; at most 500.
-
expected_revisionstring requiredrevisionfrom the latest list call. If the configuration was saved since, the call fails without saving; read again. -
dry_runboolean optionalCheck the change and report what it would do, without saving.
-
allow_new_errorsboolean optionalSave even when the change adds configuration errors. They are still returned in
new_errors.
Output
-
savedboolean requiredWhether anything was saved. False for a dry run and when no value differed from what was saved.
-
revisionstring requiredThe configuration's revision after the call.
-
What changed, in key order.
-
new_errorsarray requiredConfiguration errors the change adds. Empty for a saved change unless
allow_new_errorswas set. -
fixed_errorsarray requiredConfiguration errors the change removes.
-
warningsarray requiredThings that were accepted but look off, such as an enum value outside its options.
Usage Examples
A banner title in English and French
Request
{
"expected_revision": "1086983a00000003:2:7:3",
"items": [
{
"key": "hero-banner.title.string",
"localized_strings": {
"fr-FR": "Gagnez plus"
},
"string": "Earn more"
}
]
}
Response
{
"changes": [
{
"key": "hero-banner.title.string",
"new": "Earn more",
"old": "Welcome"
},
{
"key": "hero-banner.title.string",
"language": "fr-FR",
"new": "Gagnez plus"
}
],
"fixed_errors": [],
"new_errors": [],
"revision": "1086983a00000003:2:8:3",
"saved": true,
"warnings": []
}
Specific Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 400 | bad_data |
A key, language or text was refused, the configuration changed since it was read, or the change would add configuration errors. Nothing was saved. For example: |
| 403 | access_denied |
Your permissions do not allow this call, changing base texts, or editing custom code. |
Global Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 401 | invalid_token |
The provided authentication token is invalid or has expired. For example: |