RECIPE: Create Product from Image (Catalog V1)

Download skillThe skill is a reference md and part of wix-manage skill. You can use the following command to add the full wix-manage skill to your project:
Copy

Catalog V1 only. This recipe uses the Catalog V1 API (/stores/v1/products). It will NOT work on sites using Catalog V3. If the site uses Catalog V3, use the Create Product with Options (Catalog V3) recipe instead and include media inline in the product creation request. Check the site's catalog version in dynamic context before proceeding.

This recipe creates a Wix Store product from an image. It has exactly 4 steps that MUST ALL be completed in order. Do NOT report success until ALL 4 steps have been executed successfully.

Prerequisites:

  • The site MUST be using Catalog V1. If the site uses Catalog V3, do NOT use this recipe.
  • The user MUST provide a publicly accessible image URL (starts with https:// or http://).
  • If the user uploaded an image directly to the chat instead of providing a URL, you MUST ask them: "Please provide a public URL where the image is hosted (e.g., an Unsplash, Imgur, or any https:// link). I cannot use images uploaded directly to the chat — I need a publicly accessible URL that the Wix Media API can download from."
  • Do NOT proceed until you have a valid public URL.

STEP 1: Upload the Image to Wix Media Manager (MANDATORY)

API Endpoint: POST https://www.wixapis.com/site-media/v1/files/import

Request body fields:

FieldTypeRequiredDescription
urlstringYesThe publicly accessible HTTP/HTTPS URL of the image. MUST start with https:// or http://. CANNOT be a file ID, file reference, local path, or chat-uploaded file token.
mimeTypestringRecommendedThe MIME type of the image. Use image/jpeg for .jpg/.jpeg files, image/png for .png files, image/webp for .webp files.
displayNamestringNoA display name for the file in Media Manager. Include the file extension (e.g., product-image.jpg).

Exact request example:

Copy

Expected response:

Copy

After this step, save these values — you need them later:

  • file.url — the wixstatic.com URL (use in Step 4)
  • file.id — the media file ID

If the response contains operationStatus: "FAILED": The source URL is not accessible. Ask the user for a different image URL.


STEP 2: Analyze the Image and Generate Product Details

Look at the image from the URL provided by the user. Based on what you see in the image, generate the following three values:

  1. Product name — A concise, appealing product name. Maximum 80 characters. Example: "Premium Spinning Fishing Reel".
  2. Product description — A marketing description of 2-3 sentences. MUST be wrapped in HTML <p> tags. Example: "<p>A sleek black-and-gold spinning fishing reel designed for smooth retrieves. Ideal for freshwater or light saltwater fishing.</p>". Do NOT use plain text without <p> tags — the API will reject it.
  3. Product price — A reasonable retail price as a number (not a string). Example: 79.99.

CRITICAL: These values MUST describe the actual product visible in the image. Do NOT use generic placeholder text.


STEP 3: Create the Product

API Endpoint: POST https://www.wixapis.com/stores/v1/products

Request body fields:

FieldTypeRequiredValue
product.namestringYesThe product name from Step 2 (max 80 chars)
product.descriptionstringYesThe HTML description from Step 2 (wrapped in <p> tags)
product.visiblebooleanYestrue
product.productTypestringYes"physical" (only supported value)
product.priceData.pricenumberYesThe price from Step 2

Exact request example (using values from Step 2):

Copy

Expected response (partial):

Copy

After this step, save this value — you need it in Step 4:

  • product.id — the product ID (a UUID string like "a1b2c3d4-e5f6-7890-abcd-ef1234567890")

STEP 4: Attach the Image to the Product (MANDATORY — DO NOT SKIP)

API Endpoint: POST https://www.wixapis.com/stores/v1/products/{id}/media

Replace {id} in the URL with the product.id from Step 3.

Request body fields:

FieldTypeRequiredDescription
mediaarrayYesArray of media objects to attach
media[].urlstringYesThe file.url (wixstatic.com URL) from Step 1. Do NOT use the original image URL — use the wixstatic.com URL returned by the Media Manager.

Exact request example:

URL: POST https://www.wixapis.com/stores/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890/media

Copy

Expected response: Empty object {} — this means success.

This step is MANDATORY. The product is not complete without its image. Do NOT report success to the user before this step returns successfully.


Completion Checklist

Before reporting success to the user, verify ALL of the following:

  • Step 1 completed: Image was uploaded to Wix Media Manager and you received a wixstatic.com URL.
  • Step 2 completed: You analyzed the image and generated a name, description, and price.
  • Step 3 completed: Product was created and you received a product ID.
  • Step 4 completed: Image was attached to the product using the Add Product Media endpoint.

Only after ALL 4 steps succeed, report to the user: the product name, price, and that it was created with the image attached.


Troubleshooting

"The url field must be a publicly accessible URL"

The user provided a file ID, file token, or local file reference instead of a public URL. Ask for a URL that starts with https://.

Image import fails (operationStatus: FAILED)

The source server blocks external requests. Ask the user for a different image URL. Reliable sources: Unsplash (images.unsplash.com), Pexels (images.pexels.com), Imgur, public S3/GCS buckets.

Product created but no image visible

You used the original external URL instead of the wixstatic.com URL in Step 4. Always use the file.url from Step 1's response.

428 Precondition Required on product creation

The site uses Catalog V3, not V1. Use POST https://www.wixapis.com/stores/v3/products instead and format the description as rich text nodes (not HTML).

References

Did this help?