Skip to main content
POST
/
admin
/
translations
/
settings
/
batch
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.batchSettings({
  create: [
    {
      entity_type: "product",
      fields: ["title", "description"],
      is_active: true
    }
  ],
  update: [
    {
      id: "trset_123",
      fields: ["title", "description", "subtitle"],
      is_active: true
    }
  ],
  delete: ["trset_456"]
})
.then(({ created, updated, deleted }) => {
  console.log(created, updated, deleted)
})
{
  "created": [
    {
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z",
      "entity_type": "product",
      "fields": [
        "<string>"
      ],
      "is_active": true
    }
  ],
  "updated": [
    {
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z",
      "entity_type": "product",
      "fields": [
        "<string>"
      ],
      "is_active": true
    }
  ],
  "deleted": {
    "ids": [
      "<string>"
    ],
    "object": "<string>",
    "deleted": true
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

The translation settings to create, update, or delete in batch.

create
object[]

The translation settings to create.

update
object[]

The translation settings to update.

delete
string[]

The translation settings to delete.

The IDs of the translation settings to delete.

Response

OK

The result of managing the translation settings in batch.

created
object[]
required

The created translation settings.

updated
object[]
required

The updated translation settings.

deleted
object
required

The deletion result.