create_product
Add a product to your storefront with name, price, and images. For multi-SKU items, define attributes and variations. The backend generates the slug and publishes it automatically.
Instructions
Create a product so the storefront has real merchandise (grid-product / slider-product bindings need this). Simple use: pass name + price (+ images, category_ids). One default variation with the price/stock is created for you. Advanced use: pass attributes (e.g. Color/Size) + variations for a multi-SKU product. Images must be HOSTED URLs — get them from search_images or upload_images first. The backend generates id, slug and publishes the product.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | SKU / custom_id for the simple case (auto-generated if omitted) | |
| name | Yes | Product name | |
| price | No | Selling price (used when you don't pass variations). Required unless variations are given. | |
| stock | No | Stock quantity for the simple single-variation case | |
| images | No | Hosted image URLs (search_images/upload_images). First image becomes the product thumbnail. | |
| attributes | No | Variant axes, e.g. [{name:'Color',values:['Đen','Trắng']},{name:'Size',values:['S','M','L']}] | |
| variations | No | Explicit per-SKU variations. Omit to auto-build one from price/stock/sku. | |
| description | No | Full product description (HTML allowed) — binds to product::description on the detail page. | |
| category_ids | No | Product category IDs to file the product under (from create_product_category / list_categories) | |
| original_price | No | List/compare-at price for the simple single-variation case | |
| short_description | No | Short description / tagline (HTML allowed) — binds to product::short_description on cards + the detail page. Set this so cards aren't blank. |