Translations API Routes
A translation is a localized version of content in a specific locale. For example, a product description in French. These API routes allow admin users to manage translations for different locales and resources.
GET /admin/translations#
List Translations
Retrieve a list of translations. The translations can be filtered by fields such as reference_id (For example, the ID of a product). The translations can also be sorted or paginated.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
qstringOptionalreference_idstring | string[]OptionalreferencestringOptionalproduct or product_variant.locale_codestring | string[]OptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.$andobject[]Optional$orobject[]OptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberestimate_countnumberOptionaltranslationsobject[]The list of translations.
translationsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/translations/batch#
Manage Translations
Manage translations in bulk by creating, updating, or deleting multiple translations in a single request. You can manage translations for various resources such as products, product variants, categories, and more.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request body (application/json)
createobject[]OptionalThe translations to create.
createobject[]Optionalupdateobject[]OptionalThe translations to update.
updateobject[]Optionaldeletestring[]OptionalRequest examples
Responses
200 OK
createdobject[]The created translations.
createdobject[]updatedobject[]The updated translations.
updatedobject[]deletedobjectSummary of the deleted translations.
deletedobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
translation.created: Emitted when translations are created.translation.updated: Emitted when translations are updated.translation.deleted: Emitted when translations are deleted.
GET /admin/translations/entities#
List Translatable Entities
Retrieve a list of translatable entities. The entities can be filtered by fields such as id. The entities can also be sorted or paginated.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
typestringproductidstring | string[]OptionallimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
dataobject[]The list of translatable entities.
dataobject[]countnumberoffsetnumberlimitnumber400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/translations/settings#
List Translation Settings
Retrieve the list of translatable fields for all entities, such as products and collections. You can also filter the results by entity type or active entities.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
entity_typestringOptionalproductis_activebooleanOptionalRequest examples
Responses
200 OK
translation_settingsobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/translations/settings/batch#
Manage Translation Settings
Create, update, or delete multiple translation settings.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request body (application/json)
createobject[]OptionalThe translation settings to create.
createobject[]Optionalupdateobject[]OptionalThe translation settings to update.
updateobject[]Optionaldeletestring[]OptionalRequest examples
Responses
200 OK
createdobject[]The created translation settings.
createdobject[]updatedobject[]The updated translation settings.
updatedobject[]deletedobjectThe deletion result.
deletedobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/translations/statistics#
Retrieve Translation Statistics
Get statistics on translations for specified locales and entity types. This includes overall translation progress for each entity type, and statistics for each locale within those entity types.
translation feature flag is enabled. Set the MEDUSA_FF_TRANSLATION environment variable to true to enable it.Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
localesstring | string[]entity_typesstring | string[]Request examples
Responses
200 OK
statisticsobjectThe translation statistics for different entity types. The key is the entity type, and the value is an object containing the statistics for that entity type.
statisticsobject400, 401, 404, 409, 422, 500: an error response is returned.