Theme API

Write Call

UpdateShopStrings1

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

  • language string optional

    The language of each item's string; empty means the base language. A translation language from languages: a locale such as fr-FR, or a venue or market context such as store:fr-FR.

  • items array of ShopStringUpdate1 required

    The strings to change; at most 500.

  • expected_revision string required

    revision from the latest list call. If the configuration was saved since, the call fails without saving; read again.

  • dry_run boolean optional

    Check the change and report what it would do, without saving.

  • allow_new_errors boolean optional

    Save even when the change adds configuration errors. They are still returned in new_errors.

Output

  • saved boolean required

    Whether anything was saved. False for a dry run and when no value differed from what was saved.

  • revision string required

    The configuration's revision after the call.

  • changes array of ThemeSettingChange1 required

    What changed, in key order.

  • new_errors array required

    Configuration errors the change adds. Empty for a saved change unless allow_new_errors was set.

  • fixed_errors array required

    Configuration errors the change removes.

  • warnings array required

    Things 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: promo.1086983a00003001.title is text of a tier, reward, way to earn or similar: change it where that is configured (update_configuration); only its translations change here

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: The token has expired

Previous
ReplaceShopMedia1