Config Product Creation
This API is offering to create Configurable Product.
Create Simple (Child) Product
POST {{Base_url}}/rest/V1/products
Body
{
"product": {
"sku": "simple-product-sku1_color",
"name": "Simple Product 1",
"price": 50,
"status": 1,
"type_id": "simple",
"attribute_set_id": 92,
"visibility": 1,
"extension_attributes": {
"stock_item": {
"qty": 100,
"is_in_stock": true
}
},
"custom_attributes": [
{
"attribute_code": "color_dropdown",
"value": "1922" //Color Dropdown ID
}
]
}
}Product JSON Object Explanation
"product"
Root object representing the product data being created.
Attributes in product:
"sku"Type: String.
Unique identifier for the product, e.g.,
"simple-product-sku1_color".
"name"Type: String.
The product's name, e.g.,
"Simple Product 1".
"price"Type: Float.
The product's price, e.g.,
50.
"status"Type: Integer.
Product status:
1for enabled,0for disabled.
"type_id"Type: String.
Product type, e.g.,
"simple"for a simple product.
"attribute_set_id"Type: Integer.
ID of the attribute set to which this product belongs (e.g.,
92).
"visibility"Type: Integer.
Visibility on the storefront:
1: Not visible individually.2: Catalog only.3: Search only.4: Catalog and search.
Extension Attributes
"stock_item"
Represents stock and inventory data:
"qty": Quantity in stock, e.g.,100."is_in_stock": Boolean to indicate if the product is in stock (trueorfalse).
Custom Attributes
"custom_attributes"
A list of additional attributes for the product:
"attribute_code": Identifier for the attribute (e.g.,"color_dropdown")."value": Value for the attribute (e.g.,"1922", which might represent a color ID).
Responses
Top-Level Attributes
idType: Integer.
Unique identifier for the product in Magento (e.g.,
14602).
skuType: String.
Stock Keeping Unit (unique product identifier) used for inventory and management (e.g.,
"simple-product-sku1_color").
nameType: String.
The product name displayed to customers (e.g.,
"Simple Product 1").
attribute_set_idType: Integer.
ID of the attribute set associated with this product (e.g.,
92). Attribute sets define the attributes available for the product.
priceType: Float.
Base price of the product (e.g.,
50).
statusType: Integer.
Indicates whether the product is enabled (
1) or disabled (0) in the store.
visibilityType: Integer.
Product visibility setting:
1: Not visible individually.2: Catalog only.3: Search only.4: Catalog and search.
type_idType: String.
Specifies the product type. Here,
"simple"indicates a simple product.
created_atType: String (timestamp).
Timestamp for when the product was created (
"2025-01-10 11:49:09").
updated_atType: String (timestamp).
Timestamp for when the product was last updated (
"2025-01-13 07:51:39").
extension_attributes
extension_attributeswebsite_idsType: Array.
IDs of the websites where this product is available (e.g.,
[1]).
stock_itemDetails about stock and inventory for this product:
item_id: Unique stock item ID (e.g.,432290).product_id: ID of the product associated with this stock item (e.g.,14602).stock_id: ID of the stock (e.g.,1).qty: Quantity in stock (e.g.,100).is_in_stock: Indicates if the product is in stock (true).is_qty_decimal: Whether the product allows fractional quantities (false).use_config_*: Boolean flags indicating if stock-related configurations are using global settings.min_qty: Minimum stock quantity (e.g.,0).max_sale_qty: Maximum quantity that can be purchased in one order (e.g.,100).backorders: Backorder settings (0for no backorders).notify_stock_qty: Threshold for low stock notification (e.g.,1).manage_stock: Indicates if stock management is enabled (true).
options
optionsType: Array.
Additional product options (empty here).
media_gallery_entries
media_gallery_entriesType: Array.
Media (images, videos) associated with the product (empty here).
custom_attributes
custom_attributesurl_keyURL-friendly identifier for the product (e.g.,
"simple-product-1").
options_containerDefines where product options are displayed on the product page (e.g.,
"container2").
purchase_price_capReserved for managing purchase price limits (e.g.,
"0.000000").
msrp_display_actual_price_typeDetermines how MSRP (Manufacturer Suggested Retail Price) is displayed (e.g.,
"0").
is_sclpCustom attribute, possibly related to product-specific logic (e.g.,
"0").
required_optionsIndicates if the product has required options (
"0"means no required options).
has_optionsIndicates if the product has any custom options (
"0"means no options).
popular_productCustom attribute to flag popular products (e.g.,
"0").
tax_class_idID of the tax class applied to the product (e.g.,
"2").
category_idsList of category IDs to which the product belongs (empty here).
sw_featuredCustom attribute, possibly related to featured products (
"0").
color_dropdownCustom attribute for color, storing a value that corresponds to an option ID (e.g.,
"1922").
Create Config (Parent) Product
POST {{Base_url}}/rest/V1/products
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
This cURL request is for creating a configurable product in Magento via the REST API. A configurable product allows customers to select options (like size or color) that are linked to simple products.
Payload (Product Information):
skuUnique identifier for the product (e.g.,
"configurable-product-22").
nameName of the product (e.g.,
"Configurable Product").
attribute_set_idDefines the attribute set for the product (e.g.,
92).
priceBase price of the configurable product (e.g.,
20). This acts as a placeholder since pricing is tied to associated simple products.
statusProduct status:
1for enabled,0for disabled.
visibilityVisibility setting:
4: Visible in catalog and search.
type_idIndicates the product type.
"configurable"specifies this is a configurable product.
extension_attributes:stock_itemDetails about inventory:
qty: Stock quantity (100).is_in_stock: Indicates stock availability (true).
configurable_product_optionsDefines the configurable options for the product:
attribute_id: ID of the attribute used for configuration (e.g.,"681"for color).label: Label for the configurable attribute (e.g.,"color_dropdown").position: Display order of the attribute (e.g.,0).values: Array of possible values for this attribute:value_index: Option value (e.g.,1922).
configurable_product_linksLinks the configurable product to its associated simple products:
14602: Theidof a simple product that belongs to this configurable product.
Responses
Top-Level Attributes
idUnique identifier for the configurable product (e.g.,
14603).
skuStock Keeping Unit for the configurable product (e.g.,
"configurable-product-22").
nameProduct name (e.g.,
"Configurable Product").
attribute_set_idID of the attribute set associated with this product (e.g.,
92).
priceBase price for the configurable product (e.g.,
0). Actual pricing comes from the associated simple products.
statusProduct status:
1for enabled,0for disabled.
visibilityDefines visibility:
4: Visible in catalog and search.
type_idProduct type:
"configurable".
created_at/updated_atTimestamps for when the product was created and last updated.
Extension Attributes
website_idsList of websites where this product is available (e.g.,
[1]).
stock_itemInventory details for the product:
qty: Stock quantity (e.g.,0).is_in_stock: Indicates if the product is in stock (e.g.,true).Various other attributes control stock behavior (e.g.,
min_qty,backorders, etc.).
configurable_product_optionsDefines the configurable options for this product:
id: Internal ID for this option (e.g.,1128).attribute_id: Attribute used for configuration (e.g.,"681"forcolor_dropdown).label: Display label for the option (e.g.,"color_dropdown").values: Available options:value_index: Option ID (e.g.,1922).label: Label for the option (e.g.,"New Color Option").sku: SKU of the associated simple product (e.g.,"simple-product-sku1_color").price: Price of the simple product (50.00).status: Status of the simple product (1).qty: Stock quantity for the simple product (100).
configurable_product_linksIDs of simple products associated with this configurable product (e.g.,
[14602]).
Options
optionsArray for custom product options (e.g., left empty here).
Media Gallery Entries
media_gallery_entriesProduct media details:
id: Media ID (e.g.,212576).media_type: Type of media (e.g.,"external-video").label: Media label (e.g.,"Sample Video").file: File path or image/video reference (e.g.,"/0/_/0_4.jpg").extension_attributes.video_content: Video details:video_provider: Provider (e.g.,"youtube").video_url: Video URL.video_title: Title of the video.video_description: Description of the video.
Custom Attributes
image,small_image,thumbnailPaths to product images (e.g.,
"/0/_/0.jpg").
url_keySEO-friendly URL for the product (e.g.,
"configurable-product-aaaa").
options_containerPlacement of additional options on the product page (e.g.,
"container2").
purchase_price_capReserved for price limitations (e.g.,
"0.000000").
msrp_display_actual_price_typeDefines how MSRP is displayed (e.g.,
"0").
is_sclp,required_options,has_optionsFlags indicating special behaviors or configurations (e.g.,
"0"means disabled).
image_label,small_image_label,thumbnail_labelLabels for different media types (e.g.,
"Sample Video").
popular_productCustom attribute indicating if this product is popular (e.g.,
"0").
tax_class_idTax class applied to the product (e.g.,
"2").
category_idsArray of category IDs the product belongs to (e.g.,
[]).
sw_featuredIndicates if the product is featured (e.g.,
"0").
Last updated