POST
/
admin
/
products
/
import
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.product.import({
  file // uploaded File instance
})
.then(({ transaction_id }) => {
  console.log(transaction_id)
})
{
"transaction_id": "<string>",
"summary": {
"toCreate": 123,
"toUpdate": 123
}
}

Authorizations

Authorization
string
header
required

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

Body

application/json

The import's details.

Response

202
application/json

OK

The import process's details.