medusajs/medusa · error · MedusaError
Currency with code: ${req.params.code} was not found
Error message
Currency with code: ${req.params.code} was not found What it means
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).
Source
Thrown at packages/medusa/src/api/admin/currencies/[code]/route.ts:25
import { HttpTypes } from "@medusajs/framework/types"
export const GET = async (
req: MedusaRequest<HttpTypes.AdminCurrencyParams>,
res: MedusaResponse<HttpTypes.AdminCurrencyResponse>
) => {
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
const variables = { filters: { code: req.params.code } }
const queryObject = remoteQueryObjectFromString({
entryPoint: "currency",
variables,
fields: req.queryConfig.fields,
})
const [currency] = await remoteQuery(queryObject)
if (!currency) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`Currency with code: ${req.params.code} was not found`
)
}
res.status(200).json({ currency })
}
View on GitHub (pinned to 5e06e544a2)
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
Defensive patterns
Strategy: type-guard
Validate before calling
const { currencies } = await sdk.currency.list()
const codeOk = currencies.some((c) => c.code === code.toLowerCase())
if (!codeOk) throw new Error(`Unsupported currency code: ${code}`) Type guard
const isValidISOCurrency = (code: string): boolean =>
/^[a-z]{3}$/.test(code) && SUPPORTED_CODES.has(code) Try / catch
try { await getCurrency(code) } catch (e) { if (e.statusCode === 404) showCurrencyPicker() else throw e } Prevention
- Always derive currency codes from the list endpoint
- Validate against ISO 4217 before calling
When it happens
Trigger: GET /admin/currencies/usdX (invalid/mistyped code); querying a currency not installed in the store's currency settings.
Common situations: Passing lowercase vs uppercase mismatch expectations, full currency names instead of ISO 4217 codes, or codes for currencies never enabled in the store.
Related errors
- Campaign with id: ${req.params.id} was not found
- Campaign with id "${req.params.id}" not found
- Claim with id: ${req.params.id} was not found
- Customer group with id: ${req.params.id} not found
- Customer group with id "${req.params.id}" not found
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/b87ebd21f54bdc53.
Report an issue: GitHub.