> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appcharge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Translations

> Retrieves a list of all translatable fields and their translations.

Use the `locale` parameter to return translations for a specific locale. If a field doesn't have a translation for the requested locale, the value defaults to English, `en`.

If no locale is specified, all translations are returned, including the default English values.


<RequestExample>
  ```bash Get Translations theme={"system"}
    curl -X GET \
    'https://api.appcharge.com/v1/translations' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'x-publisher-token: <x-publisher-token>' \
  ```

  ```bash Get Spanish Translations theme={"system"}
    curl -X GET \
    'https://api.appcharge.com/v1/translations?locale=es-ES' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'x-publisher-token: <x-publisher-token>' \
  ```
</RequestExample>

<ResponseExample>
  ```json Get Translations  theme={"system"}
  {
    "dynamicTranslations": [
      {
        "type": "product",
        "externalId": "SKU-12345",
        "field": "display_name",
        "locale": "es-ES",
        "value": "Espada legendaria"
      },
      {
        "type": "product",
        "externalId": "SKU-12345",
        "field": "display_name",
        "locale": "en",
        "value": "Legendary Sword"
      },
      {
        "type": "product",
        "externalId": "SKU-12345",
        "field": "display_name",
        "locale": "pl",
        "value": "Legendarny Miecz"
      },
      {
        "type": "offer_design",
        "externalId": "OD-987",
        "field": "title",
        "locale": "es-ES",
        "value": "Oferta de Verano"
      },
      {
        "type": "offer_design",
        "externalId": "OD-987",
        "field": "title",
        "locale": "en",
        "value": "Summer Offer"
      },
      {
        "type": "offer_design",
        "externalId": "OD-987",
        "field": "title",
        "locale": "pl",
        "value": "Letnia Oferta"
      }
    ],
    "staticTranslations": [
      {
        "key": "checkout.pay_button",
        "locale": "es-ES",
        "value": "Pagar ahora"
      },
      {
        "key": "checkout.pay_button",
        "locale": "en",
        "value": "Pay Now"
      },
      {
        "key": "checkout.pay_button",
        "locale": "pl",
        "value": "Zapłać teraz"
      },
      {
        "key": "ui.loading",
        "locale": "es-ES",
        "value": "Cargando…"
      },
      {
        "key": "ui.loading",
        "locale": "en",
        "value": "Loading…"
      },
      {
        "key": "ui.loading",
        "locale": "pl",
        "value": "Ładowanie…"
      }
    ]
  }
  ```

  ```json Get Spanish Translations theme={"system"}
  {
    "dynamicTranslations": [
      {
        "type": "product",
        "externalId": "SKU-12345",
        "field": "display_name",
        "locale": "es-ES",
        "value": "Espada legendaria"
      },
      {
        "type": "offer_design",
        "externalId": "OD-987",
        "field": "title",
        "locale": "es-ES",
        "value": "Oferta de Verano"
      }
    ],
    "staticTranslations": [
      {
        "key": "checkout.pay_button",
        "locale": "es-ES",
        "value": "Pagar ahora"
      },
      {
        "key": "ui.loading",
        "locale": "es-ES",
        "value": "Cargando…"
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-translations.json GET /v1/translations
openapi: 3.0.0
info:
  title: Localization API
  description: Localization API for managing dynamic and static translations.
  version: '1.0'
  contact: {}
servers:
  - url: https://api-sandbox.appcharge.com
security: []
tags: []
paths:
  /v1/translations:
    get:
      tags:
        - Localization
      description: |-
        Retrieves a list of all translatable fields and their translations. 
         
         Use the `locale` parameter to return translations for a specific locale. If a field doesn't have a translation for the requested locale, the value defaults to English, `en`. 
         
          If no locale is specified, all translations are returned, including the default English values.
      operationId: get-translations
      parameters:
        - name: locale
          in: query
          required: false
          description: >-
            The locale code. Both ISO-639 language code and ISO-3166 country
            code formats are supported.
          schema:
            type: string
            example: en-US
        - name: x-publisher-token
          required: true
          in: header
          description: The publisher token.
          schema:
            type: string
      responses:
        '200':
          description: Translations retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslationResponse'
        '400':
          description: Invalid request payload.
        '401':
          description: Missing or invalid authentication.
        '403':
          description: Insufficient permissions.
components:
  schemas:
    TranslationResponse:
      type: object
      properties:
        dynamicTranslations:
          type: array
          description: >-
            A list of translations for dynamic entities you define such as offer
            and product names.
          items:
            $ref: '#/components/schemas/DynamicTranslation'
        staticTranslations:
          type: array
          description: >-
            A list of translations for static UI elements such as button labels
            and headers.
          items:
            $ref: '#/components/schemas/StaticTranslation'
    DynamicTranslation:
      type: object
      properties:
        type:
          type: string
          description: |-
            Entity type. 
             Values include: 'offer', 'offer_design', 'product', 'section', 'builder', 'ribbon'
          example: section
        externalId:
          type: string
          description: The ID as defined in the Publisher Dashboard.
          example: my-bundle-1
        field:
          type: string
          description: |-
            The entity field the translation applies to. 
             Values include: 'display_name', 'description', 'title', 'text', 'prefix', 'suffix'
          example: description
        locale:
          type: string
          description: >-
            The locale code. Both ISO-639 language code and ISO-3166 country
            code formats are supported.
          example: es-ES
        value:
          type: string
          description: The translation text for the specified field and locale.
          example: Hola!
    StaticTranslation:
      type: object
      properties:
        key:
          type: string
          description: The key identifier for the static translation.
          example: checkout.pay_button
        locale:
          type: string
          description: >-
            The locale code. Both ISO-639 language code and ISO-3166 country
            code formats are supported.
          example: es-ES
        value:
          type: string
          description: The translation value associated with the key and locale.
          example: Zapłać teraz

````