Skip to content

Get a template's translations

API v2 is in public beta: endpoints and fields can change before general availability. See the changelog

GET/account/templates/{campaign_type}/translations

Costs 1 rate-limit point · Rate limits

Read every translation override on the preorder confirmation template, plus the full enumeration of translatable field paths, each field's default-locale source text, and every locale the shop has actually published. campaign_type is "preorder"; back-in-stock notifications are GET /back_in_stock/templates/:key/translations.

translations holds only the fields with an override, by locale; source_values is the text in default_locale, the alert language. published_locales always includes the alert language and can lag a change in Shopify by a few minutes. Write a translation with PATCH /preorders/templates/confirmation and its locale. A shop with no preorder notification gets 404 not_found; a campaign_type other than preorder gets 422 invalid_params.

Also searched asget notification translationstemplate translationsemail translationssms translations

Path parameters

  • campaign_typestringRequired

    The template's campaign type; only preorder is supported.

    One of preorder

Query parameters

  • positioninteger

    Position of the notification in the campaign, 0 for the first (default).

    Default 0

Returns

  • default_localestring
    Example: string
  • localesarray of strings
  • published_localesarray of strings
  • fieldsarray of strings
  • source_valuesobject
    Show 10 child attributesHide child attributes
    • email.subjectstring
      Example: string
    • email.preheadernull
    • email.headerstring
      Example: string
    • email.descriptionstring
      Example: string
    • email.footerstring
      Example: string
    • email.button_textstring
      Example: string
    • email.unsubscribe_textstring
      Example: string
    • email.consent_textstring
      Example: string
    • email.reviews_titlestring
      Example: string
    • sms.bodystring
      Example: string
  • translationsobject
    Show 1 child attributeHide child attributes
    • frobject
      Show 1 child attributeHide child attributes
      • email.subjectstring
        Example: string

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

422
invalid_params

One or more fields failed the action's schema.

422
validation_failed

The request failed validation.

Any request can also fail with auth_invalid (401) or rate_limited (429).

Every error has the same shape: see Errors and the list of error codes.

GET/account/templates/{campaign_type}/translations
curl "https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations" \
  -H "X-Auth-Token: $STOQ_API_KEY"
Response
{
  "default_locale": "string",
  "locales": [
    "string"
  ],
  "published_locales": [
    "string"
  ],
  "fields": [
    "string"
  ],
  "source_values": {
    "email.subject": "string",
    "email.preheader": null,
    "email.header": "string",
    "email.description": "string",
    "email.footer": "string",
    "email.button_text": "string",
    "email.unsubscribe_text": "string",
    "email.consent_text": "string",
    "email.reviews_title": "string",
    "sms.body": "string"
  },
  "translations": {
    "fr": {
      "email.subject": "string"
    }
  }
}