Skip to main content

Instant Translate Storefront Texts (v1)

Method & Path​

POST /api/v1/public/storefront/stores/:slug/translate

Actual backend path: /v1/public/storefront/stores/:slug/translate

Description​

Machine-translate catalog / CMS strings for the public storefront (product names, category names, marquee, etc.). Translations are not entered manually — they are generated via Google Cloud Translation (preferred) or OpenAI, and cached.

Personas:

  • Customer: uses this endpoint from the storefront when the Workspace Owner has enabled instant translation.
  • Workspace Owner / Staff (store.manage): enable the feature with appearance.instantTranslationEnabled on Update Store.

Authentication​

None (public). Requires appearance.instantTranslationEnabled === true on the store; otherwise returns 403.

Headers​

HeaderTypeRequiredDescription
Content-TypestringYesapplication/json

Path Parameters​

ParameterTypeRequiredDescription
slugstringYesPublic store slug

Request Body​

{
"texts": ["كريم مرطب", "سيروم فيتامين سي"],
"targetLanguage": "he",
"sourceLanguage": "ar"
}
FieldTypeRequiredDescription
textsstring[]Yes1–80 strings, each ≤ 4000 chars; total ≤ 24000 chars
targetLanguage"ar" | "en" | "he"YesCustomer display language
sourceLanguage"ar" | "en" | "he" | "auto"NoContent language (defaults to auto)

Response 200 OK​

{
"translations": [
{ "source": "كريم مرطب", "translated": "קרם לחות" },
{ "source": "سيروم فيتامين سي", "translated": "סרום ויטמין C" }
],
"provider": "google",
"cachedCount": 0,
"translatedCount": 2
}
FieldDescription
providergoogle | openai | identity | cache
cachedCountStrings served from cache
translatedCountStrings freshly translated in this request

Common Errors​

  • 400 Bad Request: Invalid body, or neither Google credentials nor OPENAI_API_KEY configured
  • 403 Forbidden: Instant translation disabled for this store
  • 404 Not Found: Store slug not found / unpublished
  • 500 Internal Server Error: Unexpected provider failure