{"record":{"id":"be33f174c8c43551","repo":"medusajs/medusa","slug":"customer-group-with-id-req-params-id-not-found","errorCode":null,"errorMessage":"Customer group with id: ${req.params.id} not found","messagePattern":"Customer group with id: (.+?) not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/customer-groups/[id]/route.ts","lineNumber":25,"sourceCode":"  MedusaResponse,\n} from \"@medusajs/framework/http\"\n\nimport { MedusaError } from \"@medusajs/framework/utils\"\nimport { refetchCustomerGroup } from \"../helpers\"\nimport { HttpTypes } from \"@medusajs/framework/types\"\n\nexport const GET = async (\n  req: AuthenticatedMedusaRequest<HttpTypes.SelectParams>,\n  res: MedusaResponse<HttpTypes.AdminCustomerGroupResponse>\n) => {\n  const customerGroup = await refetchCustomerGroup(\n    req.params.id,\n    req.scope,\n    req.queryConfig.fields\n  )\n\n  if (!customerGroup) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Customer group with id: ${req.params.id} not found`\n    )\n  }\n\n  res.status(200).json({ customer_group: customerGroup })\n}\n\nexport const POST = async (\n  req: AuthenticatedMedusaRequest<\n    HttpTypes.AdminUpdateCustomerGroup,\n    HttpTypes.SelectParams\n  >,\n  res: MedusaResponse<HttpTypes.AdminCustomerGroupResponse>\n) => {\n  const existingCustomerGroup = await refetchCustomerGroup(\n    req.params.id,\n    req.scope,","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/customer-groups/[id]/route.ts#L7-L43","documentation":"The GET /admin/customer-groups/:id route refetches the customer group via remote query and throws NOT_FOUND (HTTP 404) when the id does not match any group.","triggerScenarios":"GET /admin/customer-groups/:id with a deleted or nonexistent group id.","commonSituations":"Group deleted while its detail page was open; stale links from notifications; environment mismatch.","solutions":["List groups via GET /admin/customer-groups to confirm the id","Handle 404 by routing back to the groups list","Verify backend URL/environment"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { customer_groups } = await sdk.admin.customerGroup.list({ id })\nif (!customer_groups.length) throw new Error(\"group not found\")","typeGuard":"null","tryCatchPattern":"try { await getGroup(id) } catch (e) { if (e.statusCode === 404) navigate(\"/customer-groups\") else throw e }","preventionTips":["Refresh group references after deletions","Guard detail routes with existence checks"],"tags":["admin-api","customer-groups","not-found"],"backgroundTag":"http-404-resource-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}