Skip to main content

Product API
APIs

The Product API provides an extension with data about the current Product.

Supporting targets

number
required

The unique identifier for the product.

number
required

The unique identifier for the product variant.

Was this section helpful?

Examples of using the Product API.

Was this section helpful?

Retrieve the ID of the product.

jsx

import {render} from 'preact';

export default async () => {
render(<Extension />, document.body);
};

const Extension = () => {
return (
<s-navigator initial-screen-name="ProductApi">
<s-screen name="ProductApi" title="Product Api">
<s-scroll-box>
<s-text>Product ID: {shopify.product.id}</s-text>
</s-scroll-box>
</s-screen>
</s-navigator>
);
};