Get a template's translations
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/account/templates/{campaign_type}/translationsCosts 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_typestringRequiredThe template's campaign type; only preorder is supported.
One ofpreorder
Query parameters
positionintegerPosition of the notification in the campaign, 0 for the first (default).
Default0
Returns
default_localestringExample:stringlocalesarray of stringspublished_localesarray of stringsfieldsarray of stringssource_valuesobjectShow 10 child attributesHide child attributes
email.subjectstringExample:stringemail.preheadernullemail.headerstringExample:stringemail.descriptionstringExample:stringemail.footerstringExample:stringemail.button_textstringExample:stringemail.unsubscribe_textstringExample:stringemail.consent_textstringExample:stringemail.reviews_titlestringExample:stringsms.bodystringExample:string
translationsobjectShow 1 child attributeHide child attributes
frobjectShow 1 child attributeHide child attributes
email.subjectstringExample:string
Errors
not_foundThe path is valid but nothing with that id exists in this store.
invalid_paramsOne or more fields failed the action's schema.
validation_failedThe 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.
curl "https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)curl "https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations?position=0" \
-H "X-Auth-Token: $STOQ_API_KEY"const res = await fetch("https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations?position=0", {
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations?position=0",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/account/templates/{campaign_type}/translations?position=0")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"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"
}
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Offer not found"
],
"code": "not_found",
"details": [
{
"code": "not_found",
"message": "Offer not found",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}