{"record":{"id":"d4e30d6c47408521","repo":"medusajs/medusa","slug":"price-list-with-id-id-was-not-found","errorCode":null,"errorMessage":"Price list with id: ${id} was not found","messagePattern":"Price list with id: (.+?) was not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/price-lists/helpers.ts","lineNumber":29,"sourceCode":"export const fetchPriceList = async (\n  id: string,\n  scope: MedusaContainer,\n  fields: string[]\n) => {\n  const remoteQuery = scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n\n  const queryObject = remoteQueryObjectFromString({\n    entryPoint: \"price_lists\",\n    variables: {\n      filters: { id },\n    },\n    fields,\n  })\n\n  const [priceList] = await remoteQuery(queryObject)\n\n  if (!isPresent(priceList)) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Price list with id: ${id} was not found`\n    )\n  }\n\n  return transformPriceList(priceList)\n}\n\nexport const transformPriceList = (priceList) => {\n  priceList.rules = buildPriceListRules(priceList.price_list_rules)\n  priceList.prices = buildPriceSetPricesForCore(priceList.prices)\n\n  delete priceList.price_list_rules\n\n  return priceList\n}\n\nexport const fetchPriceListPriceIdsForProduct = async (","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/price-lists/helpers.ts#L11-L47","documentation":"Thrown by the fetchPriceList helper when a remoteQuery for the price list id returns no present record. It is used by price-list routes to refetch after mutations; a missing/soft-deleted price list produces this NOT_FOUND error.","triggerScenarios":"Any admin price-list route that refetches after update/delete (or GET via this helper) with an id that does not exist or was deleted.","commonSituations":"Continuing to operate on a price list deleted in another tab or by another admin, expired price lists being cleaned up, or a typo'd id in custom scripts.","solutions":["Confirm the price list exists with GET /admin/price-lists/:id and handle the 404 gracefully","If it was deleted, recreate it or stop referencing it","Audit custom code for hardcoded price list ids after data resets/seeding"],"exampleFix":"// before\nawait sdk.admin.priceList.update(plId, { prices })\n\n// after\ntry {\n  await sdk.admin.priceList.update(plId, { prices })\n} catch (e) {\n  if (e.statusCode === 404) return // price list gone; nothing to update\n  throw e\n}","handlingStrategy":"try-catch","validationCode":"const { price_lists } = await sdk.admin.priceList.list()\nif (!price_lists.some((p) => p.id === plId)) throw new Error(`Missing price list ${plId}`)","typeGuard":"const isPriceList = (v: unknown): v is HttpTypes.AdminPriceList =>\n  !!v && typeof v === \"object\" && \"id\" in v && \"prices\" in v","tryCatchPattern":"try {\n  return await updatePriceList(id, patch)\n} catch (e: any) {\n  if (e.statusCode === 404) return null // already deleted\n  throw e\n}","preventionTips":["Handle 404 as a no-op for post-deletion refetches in sync jobs","Re-seed and re-map ids after db resets","Avoid hardcoded price list ids"],"tags":["admin","price-lists","not-found","rest-api"],"backgroundTag":"resource-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}