{"record":{"id":"a082dc4463daf40f","repo":"medusajs/medusa","slug":"service-zone-with-id-req-params-zone-id-not-fo","errorCode":null,"errorMessage":"Service zone with id: ${req.params.zone_id} not found","messagePattern":"Service zone with id: (.+?) not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/fulfillment-sets/[id]/service-zones/[zone_id]/route.ts","lineNumber":40,"sourceCode":"\nexport const GET = async (\n  req: AuthenticatedMedusaRequest<HttpTypes.AdminServiceZonesParams>,\n  res: MedusaResponse<AdminServiceZoneResponse>\n) => {\n  const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n\n  const [service_zone] = await remoteQuery(\n    remoteQueryObjectFromString({\n      entryPoint: \"service_zones\",\n      variables: {\n        id: req.params.zone_id,\n      },\n      fields: req.queryConfig.fields,\n    })\n  )\n\n  if (!service_zone) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Service zone with id: ${req.params.zone_id} not found`\n    )\n  }\n\n  res.status(200).json({ service_zone })\n}\n\nexport const POST = async (\n  req: MedusaRequest<\n    HttpTypes.AdminUpdateFulfillmentSetServiceZone,\n    HttpTypes.AdminServiceZonesParams\n  >,\n  res: MedusaResponse<AdminFulfillmentSetResponse>\n) => {\n  const fulfillmentModuleService = req.scope.resolve<IFulfillmentModuleService>(\n    Modules.FULFILLMENT\n  )","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/fulfillment-sets/[id]/service-zones/[zone_id]/route.ts#L22-L58","documentation":"The GET /admin/fulfillment-sets/:id/service-zones/:zone_id route queries for the service zone scoped to the fulfillment set; if no zone matches it throws NOT_FOUND (HTTP 404).","triggerScenarios":"GET /admin/fulfillment-sets/:id/service-zones/:zone_id where zone_id is wrong or belongs to a different fulfillment set.","commonSituations":"Zone deleted or moved to another fulfillment set while its page was open; copy-paste of zone ids between sets.","solutions":["List zones via GET /admin/fulfillment-sets/:id/service-zones and use those ids","Verify the zone belongs to the given fulfillment set","Handle 404 by returning to the fulfillment set detail view"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { service_zones } = await getFulfillmentSetZones(setId)\nif (!service_zones.some((z) => z.id === zoneId)) throw new Error(\"zone not in set\")","typeGuard":"const zoneBelongsToSet = (zones: {id:string}[], zoneId: string) =>\n  zones.some((z) => z.id === zoneId)","tryCatchPattern":"try { await getZone(setId, zoneId) } catch (e) { if (e.statusCode === 404) navigate(`/fulfillment-sets/${setId}`) else throw e }","preventionTips":["Always source zone ids from the parent set's zone list","Refresh zones after structural changes to fulfillment sets"],"tags":["admin-api","fulfillment","service-zones","not-found"],"backgroundTag":"http-404-nested-resource-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}