{"record":{"id":"b87ebd21f54bdc53","repo":"medusajs/medusa","slug":"currency-with-code-req-params-code-was-not-fou","errorCode":null,"errorMessage":"Currency with code: ${req.params.code} was not found","messagePattern":"Currency with code: (.+?) was not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/currencies/[code]/route.ts","lineNumber":25,"sourceCode":"import { HttpTypes } from \"@medusajs/framework/types\"\n\nexport const GET = async (\n  req: MedusaRequest<HttpTypes.AdminCurrencyParams>,\n  res: MedusaResponse<HttpTypes.AdminCurrencyResponse>\n) => {\n  const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n\n  const variables = { filters: { code: req.params.code } }\n\n  const queryObject = remoteQueryObjectFromString({\n    entryPoint: \"currency\",\n    variables,\n    fields: req.queryConfig.fields,\n  })\n\n  const [currency] = await remoteQuery(queryObject)\n  if (!currency) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `Currency with code: ${req.params.code} was not found`\n    )\n  }\n\n  res.status(200).json({ currency })\n}\n","sourceCodeStart":7,"sourceCodeEnd":33,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/currencies/[code]/route.ts#L7-L33","documentation":"The GET /admin/currencies/:code route runs a remote query against the currency entity (from the region/currency data seeded by the currency module); an unknown code throws NOT_FOUND (HTTP 404).","triggerScenarios":"GET /admin/currencies/usdX (invalid/mistyped code); querying a currency not installed in the store's currency settings.","commonSituations":"Passing lowercase vs uppercase mismatch expectations, full currency names instead of ISO 4217 codes, or codes for currencies never enabled in the store.","solutions":["Use valid ISO 4217 codes (e.g. usd, eur) exactly as returned by GET /admin/currencies","Ensure the currency is enabled/installed in the store before querying it","List currencies first and derive the code from the response"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const { currencies } = await sdk.currency.list()\nconst codeOk = currencies.some((c) => c.code === code.toLowerCase())\nif (!codeOk) throw new Error(`Unsupported currency code: ${code}`)","typeGuard":"const isValidISOCurrency = (code: string): boolean =>\n  /^[a-z]{3}$/.test(code) && SUPPORTED_CODES.has(code)","tryCatchPattern":"try { await getCurrency(code) } catch (e) { if (e.statusCode === 404) showCurrencyPicker() else throw e }","preventionTips":["Always derive currency codes from the list endpoint","Validate against ISO 4217 before calling"],"tags":["admin-api","currencies","iso-4217","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"}