Metafield definition translations

Translate metafield definition names and select choice labels through the Store API.

Batch get definition name translations

GET read_translations and the read scope required by each definition's owner_type

Fetch definition name translations in batch.

A definition's name is the label shoppers see next to its value, for example in the platform metafield block. Names translate per definition and locale. The definition must be visible to the token and editable by the merchant (merchant_access read_write, which every merchant-owned definition is); other app-owned definitions return TRANSLATION_FIELD_NOT_TRANSLATABLE. The token also needs the read scope of the definition's owner_type. Translation CSV (resource metafield_definition) and Store Admin translate the same names. Name translations send no webhooks, like choice label translations. Returns a resources entry keyed by metafield_definition:{id} for each requested definition (at most 100 per call); a definition without a translation has an empty object. One definition the token cannot address fails the whole call with its code. Fields without a translation in this locale are omitted from the response. An omitted field is not empty: shoppers see the store's base-language value, which the resource's own GET endpoint returns. Staff-created merchant tokens also require settings.metafield_definitions:read, as in Store Admin.

Path parameters

Name Type Description
locale required string

Enabled non-default store locale.

Example: fr

Query parameters

Name Type Description
ids required string

Comma-separated metafield definition IDs.

Example: 80e4fa78-4cbe-43f9-8f8c-867e8a114acd,1b0c5f0e-7d1a-4f43-9d0f-2f6a3c1d9e21

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 404 METAFIELD_DEFINITION_NOT_FOUND

    The ID does not identify a definition visible to this token.

  • 400 TRANSLATION_FIELD_NOT_TRANSLATABLE

    The definition is app-owned and its merchant_access is not read_write, so its name is not translatable; or a field other than name was sent.

  • 403 STORE_API_SCOPE_REQUIRED

    The token lacks the translations scope or the read scope of the definition's owner_type.

  • 400 TRANSLATION_LOCALE_REQUIRED

    Locale is missing.

  • 400 TRANSLATION_LOCALE_NOT_ENABLED

    Locale is not enabled for this store.

  • 400 TRANSLATION_DEFAULT_LOCALE_FORBIDDEN

    The default locale cannot be a translation target.

  • 400 TRANSLATION_RESOURCE_ID_REQUIRED

    At least one definition ID is required.

  • 400 TRANSLATION_TOO_MANY_RESOURCES

    More than 100 definition IDs.

Batch set definition name translations

PUT write_translations and the read scope required by each definition's owner_type

Set definition translations for any languages in one call.

A definition's name is the label shoppers see next to its value, for example in the platform metafield block. Names translate per definition and locale. The definition must be visible to the token and editable by the merchant (merchant_access read_write, which every merchant-owned definition is); other app-owned definitions return TRANSLATION_FIELD_NOT_TRANSLATABLE. The token also needs the read scope of the definition's owner_type. Translation CSV (resource metafield_definition) and Store Admin translate the same names. Name translations send no webhooks, like choice label translations. A row for a definition the token cannot address fails with that row's code (METAFIELD_DEFINITION_NOT_FOUND, TRANSLATION_FIELD_NOT_TRANSLATABLE, METAFIELD_WRITE_APP_OWN_ONLY, or STORE_API_SCOPE_REQUIRED when the token lacks the definition owner's read scope). Each row is one definition in one language: id, locale (any enabled non-default store locale) and fields. Rows for several languages can be mixed in one call; send at most 100 rows (one row = one definition in one locale) and at most one row per definition and locale. Each row is saved on its own: a failing row never stops the others. Empty values clear the matching field translation; omitted fields keep their translation. Every row is validated exactly like the single translation endpoint. The response has totals (rows, saved, failed) and one results entry per row in request order: {id, locale, status} with status saved or failed. A failed row carries the full error (code, message, details); its codes are the single endpoint's codes plus TRANSLATION_ROW_DUPLICATE. A saved rich-text row whose unsafe markup was removed lists warnings. A top-level code and message give the outcome: TRANSLATIONS_SAVED (200, every row saved), TRANSLATIONS_PARTIALLY_SAVED (200, success: true; the message counts saved and failed rows and names the failure reasons, e.g. "2 saved, 1 failed. No source text found for the requested fields (description).") TRANSLATIONS_NOT_SAVED_RETRY (503 with a Retry-After header, success: false; no row saved because every row failed only with TRANSLATION_WRITE_BUSY, so the same call can be sent again after error.details.retry_after_seconds) or TRANSLATIONS_NOT_SAVED (422, success: false; no row saved and at least one row failed for another reason). Both carry the same totals and results in error.details. With an Idempotency-Key, repeating the same request re-applies nothing that already saved and retries the failed rows. A write waits at most 2 seconds for other translation writes of the same item or of a clashing name or slug (for example a translation CSV import writing the same language); writes of other items, types and languages never wait. A row or call that fails with TRANSLATION_WRITE_BUSY (HTTP 503) saved nothing: send it again after error.details.retry_after_seconds (the call's Retry-After header says the same). Every row or call either saved or reports an error; none is left in an unknown state. Staff-created merchant tokens also require settings.metafield_definitions:write, as in Store Admin.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Idempotency-Key string

Optional key for this translation write. Reuse it only with the same payload when repeating the request.

Body parameters

Name Type Description
translations required array<object>

Up to 100 rows shaped as {id, locale, fields}. The only allowed field key is name.

Example: [{"fields":{"name":"Matière"},"id":"80e4fa78-4cbe-43f9-8f8c-867e8a114acd","locale":"fr"},{"fields":{"name":"Matière"},"id":"80e4fa78-4cbe-43f9-8f8c-867e8a114acd","locale":"de"},{"fields":{"name":"Matière"},"id":"80e4fa78-4cbe-43f9-8f8c-867e8a114acd","locale":"pt-BR"}]

Errors

  • 401 UNAUTHORIZED

    Authorization header missing, malformed, or token invalid/expired.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 STORE_API_SCOPE_REQUIRED

    Token is valid but lacks the required scope for this call.

  • 429 RATE_LIMITED

    The token's request allowance is exhausted. Retry after the Retry-After header.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body is not valid JSON or a row has an unknown key or a wrongly typed value.

  • 400 TRANSLATION_NO_WRITES_PROVIDED

    translations is empty.

  • 400 TRANSLATION_TOO_MANY_ROWS

    More than 100 rows; nothing is written.

  • 503 TRANSLATIONS_NOT_SAVED_RETRY

    No row saved and every row failed only with TRANSLATION_WRITE_BUSY: send the same request again after error.details.retry_after_seconds (also the Retry-After header). error.details also has totals and one results entry per row with its error.

  • 422 TRANSLATIONS_NOT_SAVED

    No row saved and at least one row failed with an error that sending again will not fix; error.details has totals and one results entry per row with its error.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Get a definition name translation

GET read_translations and the read scope required by the definition's owner_type

Fetch the translated name of one metafield definition.

A definition's name is the label shoppers see next to its value, for example in the platform metafield block. Names translate per definition and locale. The definition must be visible to the token and editable by the merchant (merchant_access read_write, which every merchant-owned definition is); other app-owned definitions return TRANSLATION_FIELD_NOT_TRANSLATABLE. The token also needs the read scope of the definition's owner_type. Translation CSV (resource metafield_definition) and Store Admin translate the same names. Name translations send no webhooks, like choice label translations. Returns the stored name translation in the selected locale with is_outdated; a definition without a translation in this locale returns an empty fields object. Fields without a translation in this locale are omitted from the response. An omitted field is not empty: shoppers see the store's base-language value, which the resource's own GET endpoint returns. Staff-created merchant tokens also require settings.metafield_definitions:read, as in Store Admin.

Path parameters

Name Type Description
id required integer

Metafield definition ID.

Example: 7
locale required string

Enabled non-default store locale.

Example: fr

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 404 METAFIELD_DEFINITION_NOT_FOUND

    The ID does not identify a definition visible to this token.

  • 400 TRANSLATION_FIELD_NOT_TRANSLATABLE

    The definition is app-owned and its merchant_access is not read_write, so its name is not translatable; or a field other than name was sent.

  • 403 STORE_API_SCOPE_REQUIRED

    The token lacks the translations scope or the read scope of the definition's owner_type.

  • 400 TRANSLATION_LOCALE_REQUIRED

    Locale is missing.

  • 400 TRANSLATION_LOCALE_NOT_ENABLED

    Locale is not enabled for this store.

  • 400 TRANSLATION_DEFAULT_LOCALE_FORBIDDEN

    The default locale cannot be a translation target.

Set a definition name translation

PUT write_translations and the read scope required by the definition's owner_type

Set or clear the translated name of one metafield definition.

A definition's name is the label shoppers see next to its value, for example in the platform metafield block. Names translate per definition and locale. The definition must be visible to the token and editable by the merchant (merchant_access read_write, which every merchant-owned definition is); other app-owned definitions return TRANSLATION_FIELD_NOT_TRANSLATABLE. The token also needs the read scope of the definition's owner_type. Translation CSV (resource metafield_definition) and Store Admin translate the same names. Name translations send no webhooks, like choice label translations. Only name is translatable. Send an empty string to clear the translation; shoppers then see the source name. When the source name changes later, the translation is marked outdated. App tokens can translate only definitions their app owns. A write waits at most 2 seconds for other translation writes of the same item or of a clashing name or slug (for example a translation CSV import writing the same language); writes of other items, types and languages never wait. A row or call that fails with TRANSLATION_WRITE_BUSY (HTTP 503) saved nothing: send it again after error.details.retry_after_seconds (the call's Retry-After header says the same). Every row or call either saved or reports an error; none is left in an unknown state. Staff-created merchant tokens also require settings.metafield_definitions:write, as in Store Admin.

Path parameters

Name Type Description
id required integer

Metafield definition ID.

Example: 7
locale required string

Enabled non-default store locale.

Example: fr

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Idempotency-Key string

Optional key for this translation write. Reuse it only with the same payload when repeating the request.

Body parameters

Name Type Description
translations required object

Field-keyed translation values. The only allowed field is name.

Example: {"name": "Matière"}

Errors

  • 404 METAFIELD_DEFINITION_NOT_FOUND

    The ID does not identify a definition visible to this token.

  • 400 TRANSLATION_FIELD_NOT_TRANSLATABLE

    The definition is app-owned and its merchant_access is not read_write, so its name is not translatable; or a field other than name was sent.

  • 403 STORE_API_SCOPE_REQUIRED

    The token lacks the translations scope or the read scope of the definition's owner_type.

  • 400 TRANSLATION_LOCALE_REQUIRED

    Locale is missing.

  • 400 TRANSLATION_LOCALE_NOT_ENABLED

    Locale is not enabled for this store.

  • 400 TRANSLATION_DEFAULT_LOCALE_FORBIDDEN

    The default locale cannot be a translation target.

  • 403 METAFIELD_WRITE_APP_OWN_ONLY

    An app token can translate only definitions its app owns.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body is not one JSON object with only a translations object.

  • 400 TRANSLATION_STAGING_INVALID_CONTROL_CHARS

    The translated name contains unsupported control characters.

  • 400 TRANSLATION_FIELD_VALUE_TOO_LONG

    The translated name is longer than 255 characters.

  • 503 TRANSLATION_WRITE_BUSY

    Other translation writes held the item or a clashing name or slug for more than 2 seconds; nothing was saved. Send the request again after error.details.retry_after_seconds (also the Retry-After header).

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

Get a choice label translation

GET read_translations and the read scope required by the definition's owner_type

Fetch the translated label of one choice of a select metafield definition.

Select definitions (single_select, list.single_select) store choice keys as values and show each choice's label to shoppers. Labels translate per choice, not per value, so one translation covers every resource that stores that choice. The definition must be visible to the token and translatable, and the token also needs the read scope of the definition's owner_type. Read choice keys from the definition's validation_rules.choices. Fields without a translation in this locale are omitted from the response. An omitted field is not empty: shoppers see the store's base-language value, which the resource's own GET endpoint returns. Staff-created merchant tokens also require settings.metafield_definitions:read, as in Store Admin.

Path parameters

Name Type Description
id required string

Metafield definition ID.

Example: 80e4fa78-4cbe-43f9-8f8c-867e8a114acd
choiceKey required string

Choice key from the definition's validation_rules.choices.

Example: north
locale required string

Enabled non-default store locale.

Example: fr

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 404 METAFIELD_DEFINITION_NOT_FOUND

    The ID does not identify a definition visible to this token.

  • 400 TRANSLATION_FIELD_NOT_TRANSLATABLE

    The definition is not a translatable select definition.

  • 400 METAFIELD_VALUE_NOT_IN_CHOICES

    The choice key is not one of the definition's choices.

  • 403 STORE_API_SCOPE_REQUIRED

    The token lacks read_translations or the read scope of the definition's owner_type.

  • 400 TRANSLATION_LOCALE_REQUIRED

    Locale is missing.

  • 400 TRANSLATION_LOCALE_NOT_ENABLED

    Locale is not enabled for this store.

  • 400 TRANSLATION_DEFAULT_LOCALE_FORBIDDEN

    The default locale cannot be a translation target.

Set a choice label translation

PUT write_translations and the read scope required by the definition's owner_type

Set or clear the translated label of one choice of a select metafield definition.

Sets the choice label shoppers see in an enabled non-default locale. The choice key, which resources store as their value, never changes. Send an empty string to clear the translation; shoppers then see the source label. When the source label changes later, the translation is marked outdated. App tokens can translate only definitions their app owns. A write waits at most 2 seconds for other translation writes of the same item or of a clashing name or slug (for example a translation CSV import writing the same language); writes of other items, types and languages never wait. A row or call that fails with TRANSLATION_WRITE_BUSY (HTTP 503) saved nothing: send it again after error.details.retry_after_seconds (the call's Retry-After header says the same). Every row or call either saved or reports an error; none is left in an unknown state. Staff-created merchant tokens also require settings.metafield_definitions:write, as in Store Admin.

Path parameters

Name Type Description
id required string

Metafield definition ID.

Example: 80e4fa78-4cbe-43f9-8f8c-867e8a114acd
choiceKey required string

Choice key from the definition's validation_rules.choices.

Example: north
locale required string

Enabled non-default store locale.

Example: fr

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Idempotency-Key string

Optional key for this translation write. Reuse it only with the same payload when repeating the request.

Body parameters

Name Type Description
value required string

Translated label; an empty string clears it.

Example: Nord de la Thaïlande

Errors

  • 404 METAFIELD_DEFINITION_NOT_FOUND

    The ID does not identify a definition visible to this token.

  • 400 TRANSLATION_FIELD_NOT_TRANSLATABLE

    The definition is not a translatable select definition.

  • 400 METAFIELD_VALUE_NOT_IN_CHOICES

    The choice key is not one of the definition's choices.

  • 403 STORE_API_SCOPE_REQUIRED

    The token lacks read_translations or the read scope of the definition's owner_type.

  • 400 TRANSLATION_LOCALE_REQUIRED

    Locale is missing.

  • 400 TRANSLATION_LOCALE_NOT_ENABLED

    Locale is not enabled for this store.

  • 400 TRANSLATION_DEFAULT_LOCALE_FORBIDDEN

    The default locale cannot be a translation target.

  • 403 METAFIELD_WRITE_APP_OWN_ONLY

    An app token can translate only definitions its app owns.

  • 403 METAFIELD_WRITE_MERCHANT_READ_ONLY

    A non-app token addressed an app-owned definition whose merchant_access is not read_write.

  • 400 STORE_API_INVALID_REQUEST_BODY

    The body is not one JSON object with only a value field.

  • 400 INVALID_INPUT

    value is missing or null; send an empty string to clear the translation.

  • 503 TRANSLATION_WRITE_BUSY

    Other translation writes held the item or a clashing name or slug for more than 2 seconds; nothing was saved. Send the request again after error.details.retry_after_seconds (also the Retry-After header).

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.