Translate store content
Build a translation app on the Merchant API. The resource types and their ids, how to read source text, write translations safely, machine-translate a store's content for credits, count progress per language, and the errors you will meet.
A translation app adds languages to a store and fills in the store's own text in each one: products, collections, pages, blog posts, menus and the words a theme prints. It uses the Merchant API, with the scopes below, from the app's server.
This page is about content a merchant owns. For the words your own theme prints, see Translating your theme. The capability and its limits are listed under Translated commerce content.
Scopes
| Scope | Allows |
|---|---|
merchant-locales-read | GET /locales |
merchant-locales-write | Add, publish, unpublish and remove a language; set the default language |
merchant-translations-read | GET /translatable-resources and GET /translatable-resources/{type}/{id} |
merchant-translations-write | PUT /translations/{type}/{id} and DELETE /translations/{type}/{id} |
merchant-translations-machine | POST /translations/machine/quote and POST /translations/machine, see Machine translation |
The two translations scopes cover every resource type below. No product, page, menu, category or theme scope is needed to read or translate them. An app that only reads needs only the two read scopes. Machine translation needs its own scope on top of them. See Scopes and the translations reference.
Resource types
GET /translatable-resources?type=… lists one type at a time. Each item carries the source text
the merchant wrote, split into keys.
type | What it is | Keys |
|---|---|---|
product | A product | title, description (HTML), excerpt |
product_variation | A product option, such as Size | title |
product_variation_item | A value of an option, such as Large | name |
collection | A collection | name, description |
category | The category name shown on a product | name |
page | A store page | title, excerpt, seo.title, seo.description |
post | A blog post | title, excerpt, seo.title, seo.description |
menu | A navigation menu | items.<n>.label, with nested items.<n>.children.<n>.label |
theme_string | The store's theme text | <theme-slug>.<dotted-key>, for example roast.cart.title |
A key appears only when the source has a value for it. An empty field is not translatable, and it
shows up on the item once the merchant fills it in. Each key carries a type, text or html:
keep the markup of an html value and translate only its text.
page and post never overlap: page is every page that is not a blog post, and post is the
blog posts. A draft page or post is listed like a published one.
theme_string is one record per store. It lists every key of the store's active theme in a
single page, and its id is the store's own p_id. The theme slug is part of every key, so
switching theme leaves the old theme's translations dormant until you remove them with a
DELETE narrowed to those keys.
Ids
The id of an item in a list is always an integer: the record's p_id. It is the same
number the record carries as p_id elsewhere, for example on a page from GET /pages.
Use it as the stable identifier in your own database.
The retrieve and write routes accept that integer or the record's UUID in {id}. An id that
belongs to another store answers 404 not_found, as does an unknown type. For theme_string, {id} is
the store's p_id, its slug or its UUID.
Collections and categories
A store's collections and its categories are one set of rows: type=collection and
type=category list the same records, with the same ids. The general product taxonomy that every
store shares is never translatable per store, and never listed.
The two types keep separate translations. A translation written under category/2016 is not
returned when you read collection/2016, and the reverse. Each is read by a different part of the
storefront: collection supplies the name and description on collection responses, and
category supplies the category name shown on a product.
Use collection as the type you offer merchants. Write category as well when you want the product's
category name translated too, since the category type has only the name key.
The flow
The examples use the base URL https://api.usequeek.com/api/v1/merchant and the
installation token your SDK client sends in X-Client-Key.
1. Read the store's languages
curl https://api.usequeek.com/api/v1/merchant/locales \
-H "X-Client-Key: $TOKEN" -H "Accept: application/json"The response lists each language with locale, name, native_name, html_lang, dir,
published, is_primary and is_default, the default first. The store's source language appears
with is_primary: true. It is never a translation target: asking for it is
422 translation_locale_is_primary. The language object carries no address; it does not say
where shoppers reach the language.
Add a language with POST /locales and { "locale": "fr" }. It is unpublished until you publish
it with PATCH /locales/fr and { "published": true }. A store publishes at most 20 languages.
2. Read the source text
curl "https://api.usequeek.com/api/v1/merchant/translatable-resources?type=product&limit=100" \
-H "X-Client-Key: $TOKEN" -H "Accept: application/json"{
"data": [
{
"type": "product",
"id": 4021,
"content": [
{ "key": "title", "value": "Linen shirt", "digest": "…", "type": "text" },
{ "key": "description", "value": "<p>Soft, light linen.</p>", "digest": "…", "type": "html" }
],
"machine_translation_allowed": true
}
],
"has_more": true,
"next_cursor": "…"
}The digest identifies the exact source value. Keep it with the text you translate.
3. Read what is already translated
curl "https://api.usequeek.com/api/v1/merchant/translatable-resources/product/4021" \
-H "X-Client-Key: $TOKEN" -H "Accept: application/json"The response repeats content and adds translations, one row per stored locale and key:
{
"status": "success",
"message": "Translatable resource retrieved",
"data": {
"type": "product",
"id": 4021,
"content": [ … ],
"machine_translation_allowed": true,
"translations": [
{ "key": "title", "locale": "fr", "value": "Chemise en lin", "outdated": false, "origin": "human", "updated_at": "2026-10-18T09:12:00+00:00" }
]
}
}Without locale the response carries the translations of every language. Add ?locale=fr to
narrow it to one.
Each row carries an origin: human for a translation written with PUT /translations/{type}/{id},
machine for one written by machine translation. Writing over a machine row
with PUT makes it human.
A translation is outdated: true when the source value changed after it was written. The
storefront keeps showing an outdated translation until you replace it, except on menu, where
it is not shown, because a re-ordered menu would put one item's text on another.
4. Write translations
curl -X PUT https://api.usequeek.com/api/v1/merchant/translations/product/4021 \
-H "X-Client-Key: $TOKEN" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"translations": [
{ "locale": "fr", "key": "title", "value": "Chemise en lin", "digest": "…" }
]
}'Each item names a locale, a key, the translated value and the digest you read for that key.
The batch is all or nothing: if any item is wrong, nothing is written, and the error names the
item. A write replaces an existing translation of the same locale and key.
To remove translations, call DELETE /translations/{type}/{id} with locales[] and keys[] to
narrow it. With neither, it clears every translation of that record.
5. Publish the language
A language shoppers can pick must be published: PATCH /locales/{locale} with
{ "published": true }. To make it the language the store root serves, call
POST /locales/{locale}/default; the language must be published first. How a language is reached is
described under Which languages a store has.
Pagination
GET /translatable-resources is cursor paged. Send limit (default 15, at most 100). Each response
has has_more and next_cursor; pass next_cursor back as starting_after for the next page, and
stop when has_more is false. Items are ordered by p_id. A cursor belongs to one type and one
store: reusing it on another type answers 422.
Counting progress per language
The list carries source text only. It cannot filter by language, and it does not say what is translated. To show "312 of 480 texts translated in French", read the items you want to count:
- Page through the list for a type at 100 items per page.
- For each item, call
GET /translatable-resources/{type}/{id}once, withoutlocale. It returns the translations of every language together. - For each language, count the item's keys that have a row with
outdated: false. A key with no row is missing; a row withoutdated: trueneeds another look. - Cache the counts for a short time, and drop them when your app writes or removes a translation.
The cost is one request per item, not per item per language. Every request counts against the key's rate limit, which is per minute and depends on the store's plan, so a large catalogue takes minutes on a small plan. Read a bounded number of items per type, show progress for what you have read, and read the rest in the background.
Limits
| Limit | Value |
|---|---|
| Items per write | 100 |
Translated value | 50,000 characters |
key | 64 characters |
| Items per list page | 100 |
| Published languages per store | 20 |
Errors
The translation_* codes answer HTTP 422. See Merchant API errors.
| Code | Cause |
|---|---|
translation_digest_stale | The source changed after you read it. Re-read the item and translate again. |
translation_unknown_key | The record has no such key. It may be empty, or the key is misspelt. |
translation_unknown_locale | The language has not been added to the store. |
translation_locale_is_primary | The store's source language is not a translation target. |
translation_locale_is_default | The default language cannot be unpublished or removed. Pick another default first. |
translation_locale_not_published | Only the primary or a published language can be the default. |
translation_max_published_locales | The store already publishes 20 languages. |
A write error carries the position of the failing item in error.errors, for example
translations.3.digest. An unknown type, or an id from another store, is 404 not_found; a missing or
unrecognised type on the list is 422 validation_failed.
Webhooks
The locales/create, locales/update, locales/destroy, translations/update and
translations/delete topics exist. The public API document does not define the data they
carry, so do not build on its fields. Treat each event as a signal that something changed, and read
the current state from the API. See Webhooks.
Machine translation
Your app can have Queek translate the store's own text for you, instead of translating it itself. You
name the content and the language; Queek reads the store's text, translates it, saves the results
as translations and charges the store's credits. Use it when you want a first draft of a
language that a merchant then reviews, and keep PUT /translations/{type}/{id}
for text a person wrote or corrected.
It needs the merchant-translations-machine scope. An app that adds this scope to a version goes through
review as shopper-facing content, and the merchant approves it at install. Without the grant,
both calls answer 403 insufficient_scope.
The two steps
A job is two calls: a quote that prices it and changes nothing, then a run that confirms the quote. Both take the same body: references to the store's content, never text.
{
"locale": "fr",
"mode": "missing",
"resources": [
{ "type": "product", "id": 4021, "keys": ["title", "excerpt"] },
{ "type": "collection", "id": 118 }
]
}| Field | Meaning |
|---|---|
locale | The language to translate into. It must be a language the store has added, and never the store's source language. Text is always translated from the source language. |
mode | Which texts qualify: missing, outdated or missing_and_outdated. See Modes. |
resources | Up to 20 items, each a type and id as GET /translatable-resources returns them (see Resource types), with an optional keys list of up to 20 keys. Without keys, every qualifying key of the resource is translated. |
There is no text field. Queek reads the source text from the store, so your app cannot send any, and any
field other than these is rejected with 422 validation_failed. An id from another store answers
404 not_found, a language the store has not added 422 translation_unknown_locale, and a key the
resource does not have 422 translation_unknown_key.
1. Ask for a quote
curl -X POST https://api.usequeek.com/api/v1/merchant/translations/machine/quote \
-H "X-Client-Key: $TOKEN" -H "Content-Type: application/json" \
-d '{ "locale": "fr", "mode": "missing", "resources": [ { "type": "product", "id": 4021 } ] }'{
"status": "success",
"message": "Machine translation quoted",
"data": {
"quote_id": "qt_01k8m3q7x2n5v9w4b6d8f0g2h4",
"locale": "fr",
"mode": "missing",
"texts": 3,
"characters": 412,
"estimated_credits": 4,
"expires_at": "2026-10-20T12:10:00+00:00",
"held": []
}
}texts and characters are what the job will translate. estimated_credits is the most the run can
charge. held lists keys that will not be translated, each as { type, id, key, reason }: see
What is written and what is held. Show the merchant the credits
before you run.
A quote is good for 10 minutes, for one run, for the caller that asked and only for the job it
priced: the run must send the same locale, mode and references. Nothing is charged for a quote.
2. Run it
curl -X POST https://api.usequeek.com/api/v1/merchant/translations/machine \
-H "X-Client-Key: $TOKEN" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "quote_id": "qt_01k8m3q7x2n5v9w4b6d8f0g2h4", "locale": "fr", "mode": "missing",
"resources": [ { "type": "product", "id": 4021 } ] }'{
"status": "success",
"message": "Machine translation finished",
"data": {
"locale": "fr",
"mode": "missing",
"texts_written": 2,
"texts_held": 1,
"credits_charged": 3,
"items": [
{ "type": "product", "id": 4021, "key": "title", "status": "written", "reason": null },
{ "type": "product", "id": 4021, "key": "excerpt", "status": "written", "reason": null },
{ "type": "product", "id": 4021, "key": "description", "status": "held", "reason": "tags_changed" }
]
}
}Every key is answered as written or held. credits_charged is what the store paid, never more than
estimated_credits.
The Idempotency-Key header is required on the run; without it the call answers
400 idempotency_key_required before anything else. Send a new key for every run. Repeating a run with
the same key returns the first answer and charges nothing more; while the first is still running it
answers 409 idempotency_key_in_progress. A quote is spent by its run, so a second run with the same
quote_id and a different key answers 409 quote_already_used. See
Idempotency.
A run is synchronous and can take up to about half a minute. Set a client timeout well above that, for example 60 seconds.
Modes
mode | Qualifies |
|---|---|
missing | A key with no translation in that language yet. |
outdated | A key whose machine translation is out of date, because the source changed after it was written (outdated: true on the read). |
missing_and_outdated | Both. |
An out-of-date translation that a person wrote is never refreshed or overwritten by machine
translation. In the two outdated modes it is reported as held with the reason human_written, so you can
show it to the merchant and let them decide. A translation a person writes or edits after a machine one replaces it, and its
origin becomes human.
What is written and what is held
Only clean results are written, each as a translation with origin: "machine". Before a result is saved,
Queek checks it against the source text. A text that fails a check, or that cannot be saved, is held:
nothing is written for it, and the rest of the job still is. Each held key is reported with a reason.
reason | Meaning | What to do |
|---|---|---|
human_written | The key has an out-of-date translation that a person wrote. | Leave it, or ask the merchant to update it by hand. |
not_allowed | The text is on a store policy page (privacy, terms, returns or shipping), which is translated by hand. | Write it with PUT /translations/{type}/{id}. |
tags_changed | The result changed the HTML markup of the source. | Translate that key by hand. |
placeholders_changed | The result changed a placeholder of the source. | Translate that key by hand. |
numbers_changed | The result changed a number of the source. | Translate that key by hand. |
keep_term_changed | The result changed a term that must stay as written, such as the store's name. | Translate that key by hand. |
empty_output | The result had no usable text. | Run it again in a new job, or translate that key by hand. |
too_long | The result was far longer than the source. | Translate that key by hand, or run it again in a new job. |
source_changed | The source text changed while the job ran. | Ask for a new quote. |
edited | A person typed a translation for the key while the job ran. It is never overwritten. | Nothing. |
write_failed | The result could not be saved. | Run it again in a new job. |
time_budget | The job used up its time budget (25 seconds) before reaching this text. It was not translated. | Ask for a new quote and run the rest. |
service_unavailable | Machine translation stopped being available during the job. The text was not translated. | Try again shortly. |
The texts that were already written stay written. To run the rest of a job, ask for a new quote with the
same references: the keys that are now translated no longer qualify, so the new quote covers only what is
left. If machine translation is unavailable before the first text is translated, the run answers
503 machine_translation_unavailable and charges nothing.
Policy pages are never machine translated. machine_translation_allowed on each item tells you ahead of
time: it is false for those pages.
Undoing a run
Every written item names the type, id and key that now holds a machine translation. To undo a run,
call DELETE /translations/{type}/{id} for each resource, narrowed to the language and the written keys
as in step 4.
The storefront then shows the source language for those keys again. Read the item first and delete only the
keys whose origin is still machine, so you never remove a translation a person has since written.
Charges
- The quote shows the credits. A run is never charged more than its quote. The store needs at least
the quoted credits when the run starts, or the run answers
402 insufficient_creditsbefore any work, withcredits_neededandcredits_availableindata. - Nothing is charged for a quote, a refused request or an outage before any text was translated.
- Work that was completed is charged, including a text that was translated and then held by a check.
Texts held before any work, such as
human_written,not_allowedandtime_budget, cost nothing. - The store sees every run in its credit usage history, labelled "Machine translation" with the app and the number of texts, and the store owner gets a notice for a large run (currently 50 credits or more).
The merchant stays in control
The merchant can switch machine translation off for each app, in that app's settings in the dashboard. It
is on by default once the merchant has approved the scope. While it is off, both calls answer
403 machine_translation_off.
Limits
| Limit | Value |
|---|---|
| Resources per request | 20 |
| Keys per resource | 20. A resource with more qualifying texts must be narrowed with keys, or the quote answers 422 validation_failed. |
| Characters per run (the source text it translates) | 200,000. A bigger quote answers 422 translation_run_too_large. |
| Characters per store per day | 1,000,000, counted from midnight UTC. Past it, 429 translation_daily_limit. |
| Requests per minute | 30 per app and store, counted separately for quotes and runs. Past it, 429 too_many_requests: honour Retry-After. |
| Run time budget | 25 seconds. The rest is held as time_budget. |
| Quote lifetime | 10 minutes, one run |
A store with many resources takes several jobs. Send them one after another rather than in parallel.
Errors
The full list with statuses is under Merchant API errors. A refusal before any work charges nothing.
| Code | Status | Cause |
|---|---|---|
quote_expired | 410 | The quote is unknown, expired or belongs to another caller. Ask for a new one. |
quote_mismatch | 409 | The run names a different job than the quote priced. |
quote_already_used | 409 | The quote was already spent by another run. |
quote_stale | 409 | The store's content grew since the quote. Ask for a new quote. |
insufficient_credits | 402 | The store does not have the quoted credits. |
machine_translation_off | 403 | The merchant switched it off for this app. |
machine_translation_unavailable | 503 | Machine translation is unavailable for the moment. Nothing was charged. |
Quality
Review machine translations before you publish a language to shoppers. Results are less reliable for some languages than for others, and a check cannot tell a correct sentence from a natural one. Show the merchant what was written, let them correct it, and publish the language only when they are happy with it.
Try it on a dev store
A dev store created with test data has products, collections, customers, coupons and
shipping zones. It has no pages, posts or menus. To create a page, POST /pages with
merchant-pages-create; the page is a draft, and it lists as a page. To create a post, POST /posts with
merchant-posts-create. The Merchant API has no endpoint to create a menu.
Embedded apps and the dashboard bridge
How an app's page runs inside the Queek dashboard. The postMessage contract, exact origins, the handshake and its 5 and 15 second limits, how the frame is sized, and where to put dialogs.
App capabilities
What a Queek app can build with, by area: each capability, how to reach it, and example apps.