medusajs/medusa · error · MedusaError

NOT_FOUND

NOT_FOUND

Error message

Product type with id: ${req.params.id} was not found

What it means

Thrown by GET /store/product-types/:id when the query for the product type id returns no rows. The type id is invalid or deleted. Returns 404 NOT_FOUND.

Source

Thrown at packages/medusa/src/api/store/product-types/[id]/route.ts:33

  res: MedusaResponse<StoreProductTypeResponse>
) => {
  const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)

  const { data } = await query.graph(
    {
      entity: "product_type",
      filters: {
        id: req.params.id,
      },
      fields: req.queryConfig.fields,
    },
    {
      locale: req.locale,
    }
  )

  if (!data.length) {
    throw new MedusaError(
      MedusaError.Types.NOT_FOUND,
      `Product type with id: ${req.params.id} was not found`
    )
  }

  const productType = data[0]

  res.json({ product_type: productType })
}

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. List types via GET /store/product-types to confirm the id exists
  2. Regenerate filter/navigation data after type changes in the catalog
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const { product_type } = await sdk.store.productType.retrieve(id)
} catch (e: any) {
  if (e.type === 'not_found') notFound()
  throw e
}

Prevention

When it happens

Trigger: Requesting /store/product-types/ptyp_... with a nonexistent or deleted type id.

Common situations: Product type removed in admin but still referenced by frontend filters or cached URLs; typo in id.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/a29eb37d41cdf77e. Report an issue: GitHub.