{"record":{"id":"d3710d8157b539f2","repo":"medusajs/medusa","slug":"claim-with-id-req-params-id-was-not-found","errorCode":null,"errorMessage":"Claim with id: ${req.params.id} was not found","messagePattern":"Claim with id: (.+?) was not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/claims/[id]/route.ts","lineNumber":21,"sourceCode":"  MedusaResponse,\n  refetchEntity,\n} from \"@medusajs/framework/http\"\nimport { MedusaError } from \"@medusajs/framework/utils\"\nimport { AdminClaimResponse, HttpTypes } from \"@medusajs/framework/types\"\n\nexport const GET = async (\n  req: AuthenticatedMedusaRequest<{}, HttpTypes.SelectParams>,\n  res: MedusaResponse<AdminClaimResponse>\n) => {\n  const claim = await refetchEntity({\n    entity: \"order_claim\",\n    idOrFilter: req.params.id,\n    scope: req.scope,\n    fields: req.queryConfig.fields,\n  })\n\n  if (!claim) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Claim with id: ${req.params.id} was not found`\n    )\n  }\n\n  res.status(200).json({ claim })\n}\n","sourceCodeStart":3,"sourceCodeEnd":29,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/claims/[id]/route.ts#L3-L29","documentation":"The GET /admin/claims/:id route queries the order module for a claim by id (or filter) and throws NOT_FOUND (HTTP 404) when no claim matches.","triggerScenarios":"GET /admin/claims/:id where the claim id is invalid or the claim belongs to data not visible to the current scope.","commonSituations":"Opening a claim detail page for a claim created in another environment; deleted order/claim data; typo in the id from URL manipulation.","solutions":["Fetch the order's claims via GET /admin/orders/:id/claims and use those ids","Verify the claim id exists in the same environment/backend","Handle 404 gracefully in claim navigation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { claims } = await sdk.admin.order.listClaims({ id: claimId })\nif (!claims.length) throw new Error(\"claim not found\")","typeGuard":"null","tryCatchPattern":"try { await getClaim(id) } catch (e) { if (e.statusCode === 404) navigate(\"/orders\") else throw e }","preventionTips":["Derive claim ids from the order's claims relation","Guard deep links with existence checks"],"tags":["admin-api","claims","orders","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"}