Skip to content

Attribute Translations

Locale-specific names for attributes. The single endpoint is the destination of the IRI strings emitted in the translations[] array of GET /api/shop/attributes/{id} — for example /api/shop/attribute_translations/23.

⚠️ The URL uses an underscore: attribute_translations, not attribute-translations.

Most clients won't call this collection directly — they'll either:

  • read the inline translation object on the parent attribute (current locale only), or
  • follow a translations[] IRI for a single non-default locale.

Use these endpoints when you need to bulk-load every translation (e.g. for offline caching) or audit translation completeness.

Endpoints

MethodPathPurpose
GET/api/shop/attribute_translationsPaginated flat list of every translation
GET/api/shop/attribute_translations/{id}Single translation by ID

Request Headers

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesStorefront API key (pk_storefront_…)

Query Parameters (collection only)

ParameterTypeDefaultDescription
pageinteger1Page number (1-based)
per_pageinteger10Items per page. Max 50.

Pagination headers are emitted on the collection. See Pagination.

Translation Object Fields

FieldTypeDescription
idintegerTranslation primary key
attributeIdintegerOwning attribute's ID — fetch via GET /api/shop/attributes/{attributeId}
localestringLocale code (e.g. en, fr, de, ar)
namestringLocalized attribute name shown to customers in that locale

Typical Flow

GET /api/shop/attributes/23
   └─ response.translations = [
        "/api/shop/attribute_translations/23",
        "/api/shop/attribute_translations/156",
        ...
      ]

GET /api/shop/attribute_translations/156
   └─ { "id": 156, "attributeId": 23, "locale": "fr", "name": "Couleur" }

You don't need to know the translation ID up front — read the translations[] array on the attribute and dereference any entry you need.

Use Cases

  • Pre-populate a localized admin tool that lets store managers review every attribute translation in one view.
  • Build an offline cache of all attribute names per locale for an SPA.
  • Validate translation completeness — sort/filter by locale and check for empty name values.

Released under the MIT License.