Search...
createProduct( )
Developer Preview
Creates a new product.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function createProduct(product: Product): Promise<CreateProductResponse>
createProduct Parameters
NAME
TYPE
DESCRIPTION
product
Product
Product information.
Returns
Return Type:
Promise<
CreateProductResponse
>NAME
TYPE
DESCRIPTION
product
Product
Was this helpful?
createProduct example
Copy Code
1import { products } from 'wix-stores.v2';23 async function createProduct(product) {4 try {5 const result = await products.createProduct(product);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13