getProduct( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a product with the provided ID.

Permissions
Manage Stores - all permissions
Manage Products
Read Stores - all read permissions
Read Products
Manage Orders
Learn more about app permissions.
Method Declaration
Copy
function getProduct(
  _id: string,
  options: GetProductOptions,
): Promise<GetProductResponse>;
Method Parameters
_idstringRequired

Requested product ID.


optionsGetProductOptions
Returns
Return Type:Promise<GetProductResponse>
JavaScript
import { products } from "wix-stores.v2"; async function getProduct(id, options) { try { const result = await products.getProduct(id, options); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?