{"record":{"id":"5f92af9ce1967073","repo":"medusajs/medusa","slug":"product-with-id-req-params-id-was-not-found","errorCode":null,"errorMessage":"Product with id: ${req.params.id} was not found","messagePattern":"Product with id: (.+?) was not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/store/products/[id]/route.ts","lineNumber":64,"sourceCode":"  }\n\n  const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)\n\n  const { data: products } = await query.graph(\n    {\n      entity: \"product\",\n      filters,\n      context,\n      fields: req.queryConfig.fields,\n    },\n    {\n      locale: req.locale,\n    }\n  )\n  const product = products[0]\n\n  if (!product) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Product with id: ${req.params.id} was not found`\n    )\n  }\n\n  if (withInventoryQuantity) {\n    await wrapVariantsWithInventoryQuantityForSalesChannel(\n      req,\n      product.variants || []\n    )\n  }\n\n  if (includesCategoriesField) {\n    filterOutInternalProductCategories([product])\n  }\n\n  await wrapProductsWithTaxPrices(req, [product])\n  res.json({ product })","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/store/products/[id]/route.ts#L46-L82","documentation":"Thrown by GET /store/products/:id when the product query (with requested fields, locale, and store filters) returns no product. The id may be invalid, the product unpublished, or the product filtered out of the store scope. Returns 404 NOT_FOUND.","triggerScenarios":"Requesting /store/products/prod_... for a deleted product, an unpublished/draft product, or a product excluded by store filters (sales channel, region).","commonSituations":"Product unpublished during a catalog update while storefront links remain; consumer browsing a stale URL; product not assigned to the sales channel/region the request resolves to.","solutions":["Check the product exists and is published in Admin (status = published)","Ensure the product is added to the sales channel and regions your storefront uses","Implement 404 handling that shows a product-unavailable page and suggests alternatives"],"exampleFix":"// before\nconst { product } = await sdk.store.product.retrieve('prod_123') // 404 if unpublished\n\n// after\ntry {\n  const { product } = await sdk.store.product.retrieve('prod_123')\n} catch (e) {\n  if (e.type === 'not_found') notFound() // render 404 page\n}","handlingStrategy":"try-catch","validationCode":"const { products } = await sdk.store.product.list({ id: [productId] })\nif (!products.length) notFound()","typeGuard":null,"tryCatchPattern":"try {\n  const { product } = await sdk.store.product.retrieve(id)\n} catch (e: any) {\n  if (e.type === 'not_found') notFound()\n  throw e\n}","preventionTips":["Keep products published or return 410/404 pages gracefully","Verify sales channel assignment before launch","Cache product availability with short TTL"],"tags":["store-api","product","not-found"],"backgroundTag":"resource-not-found-by-id","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}