Search.../

getProduct( )

Developer Preview

Retrieves a product with the provided ID.

Syntax

function getProduct(_id: string, options: GetProductOptions): Promise<GetProductResponse>

getProduct Parameters

NAME
TYPE
DESCRIPTION
_id
string

Requested product ID.

options
Optional
GetProductOptions

Returns

Return Type:

Promise<
GetProductResponse
>
NAME
TYPE
DESCRIPTION
product
Product

Requested product data.

Was this helpful?

getProduct example

Copy Code
1import { products } from 'wix-stores.v2';
2
3 async function getProduct(id, options) {
4 try {
5 const result = await products.getProduct(id, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13