Skip to main content
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: getProductByID and getProductByHandle are exposed as promises. Verify the app version’s resolution behavior before depending on either lookup in production; use getProductMetaFields or the documented call APIs when a lookup is not available in your target runtime.

getProductByID

Fetches a product by ID.
Returns null when the product is not found.

getProductByHandle

Fetches a product by handle.
Returns null when the product is not found.

getProductMetaFields

Fetches product metafields. Pass metafield keys using namespace.key format.
The result is returned by the native product API. Treat its shape as 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, or null.