Skip to main content
GET
/
admin
/
translations
/
entities
JS SDK
import Medusa from "@medusajs/js-sdk"

export const sdk = new Medusa({
  baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
  debug: import.meta.env.DEV,
  auth: {
    type: "session",
  },
})

sdk.admin.translation.entities({
  type: "product"
})
.then(({ data, count, offset, limit }) => {
  console.log(data)
})
{
  "data": [
    {
      "id": "<string>",
      "translations": [
        {
          "id": "<string>",
          "reference_id": "prod_123",
          "reference": "product",
          "locale_code": "fr-FR",
          "translations": {
            "title": "Chaussures",
            "description": "Des chaussures élégantes."
          },
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "deleted_at": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ],
  "count": 123,
  "offset": 123,
  "limit": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

type
string
required

Filter by a translatable entity type.

Example:

"product"

id

Filter by an entity's ID.

limit
number

Limit the number of items returned in the list.

offset
number

The number of items to skip when retrieving a list.

order
string

The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.

with_deleted
boolean

The translation's with deleted.

fields
string

Comma-separated fields that should be included in the returned data. If a field is prefixed with + 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.

Response

OK

The list of translatable entities.

data
object[]
required

The list of translatable entities.

count
number
required

The total number of translatable entities.

offset
number
required

The number of items skipped before retrieving the returned items.

limit
number
required

The maximum number of items returned in the response.