ProductService lets you fetch product information and product metafields.
Use it when your extension needs product data that is not already available in the current context.
Global Name
API
Product
Methods
Implementation note:getProductByIDandgetProductByHandleare exposed as promises. Verify the app version’s resolution behavior before depending on either lookup in production; usegetProductMetaFieldsor the documented call APIs when a lookup is not available in your target runtime.
getProductByID
Fetches a product by ID.null when the product is not found.
getProductByHandle
Fetches a product by handle.null when the product is not found.
getProductMetaFields
Fetches product metafields. Pass metafield keys usingnamespace.key format.
unknown unless your shop’s metafield schema provides a narrower type.
Metafield Values
Metafield values can be strings, numbers, booleans, arrays, media objects, metaobjects, objects, ornull.