medusajs/medusa · error · MedusaError
NOT_FOUND
NOT_FOUND
Error message
Product option with id: ${req.params.id} was not found What it means
Thrown by GET /store/product-options/:id when the query for that product option id returns an empty array. The option id is invalid, deleted, or belongs to a product not visible in the store. Returns 404 NOT_FOUND.
Source
Thrown at packages/medusa/src/api/store/product-options/[id]/route.ts:29
/**
* @since 2.16.0
*/
export const GET = async (
req: AuthenticatedMedusaRequest<{}, HttpTypes.SelectParams>,
res: MedusaResponse<HttpTypes.StoreProductOptionResponse>
) => {
const query = req.scope.resolve(ContainerRegistrationKeys.QUERY)
const { data } = await query.graph({
entity: "product_option",
filters: {
id: req.params.id,
},
fields: req.queryConfig.fields,
})
if (!data.length) {
throw new MedusaError(
MedusaError.Types.NOT_FOUND,
`Product option with id: ${req.params.id} was not found`
)
}
res.json({ product_option: data[0] })
}
View on GitHub (pinned to 5e06e544a2)
Solutions
- List options via GET /store/product-options to confirm the id exists
- Refresh any cached ids on the storefront after catalog changes
- Link to the parent product page instead of a raw option when possible
Defensive patterns
Strategy: try-catch
Try / catch
try {
const { product_option } = await sdk.store.productOption.retrieve(id)
} catch (e: any) {
if (e.type === 'not_found') notFound()
throw e
} Prevention
- Fetch option ids from product payloads
- Invalidate cached catalog ids after syncs
When it happens
Trigger: Requesting /store/product-options/opt_... with a nonexistent or deleted option id, or an option belonging to an unpublished product.
Common situations: Stale deep links after option/product removal; ids cached from a previous catalog import; typos in the id.
Related errors
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/5af7afb7261945fa.
Report an issue: GitHub.