Step 3. Create the bundle product

Now we will add the bundle product. We will use two bundle options: RAM and Monitor.

Endpoint:

Copied to your clipboard
POST http://domain.com/rest/default/V1/products
Copied to your clipboard
{
"product": {
"sku": "Desktop-Computer",
"name": "Desktop Computer",
"attribute_set_id": 4,
"status": 1,
"visibility": 4,
"type_id": "bundle",
"extension_attributes": {
"stock_item": {
"qty": 100,
"is_in_stock":true
},
"website_ids": [
1
],
"category_links": [
{
"position": 0,
"category_id": "32"
}
],
"bundle_product_options": [
{
"option_id": 0,
"position": 1,
"sku": "computer-ram",
"title": "RAM",
"type": "select",
"required": true,
"product_links": [
{
"sku": "RAM-12GB",
"option_id": 1,
"qty": 1,
"position": 1,
"is_default": false,
"price": 0,
"price_type": 0,
"can_change_quantity": 0
},
{
"sku": "RAM-24GB",
"option_id": 1,
"qty": 1,
"position": 2,
"is_default": false,
"price": 0,
"price_type": 0,
"can_change_quantity": 0
}
]
},
{
"option_id": 1,
"position": 2,
"sku": "computer-monitor",
"title": "Monitor",
"type": "select",
"required": true,
"product_links": [
{
"sku": "Monitor-15",
"option_id": 2,
"qty": 1,
"position": 1,
"is_default": false,
"price": 0,
"price_type": 0,
"can_change_quantity": 0
},
{
"sku": "Monitor-17",
"option_id": 2,
"qty": 1,
"position": 2,
"is_default": false,
"price": 0,
"price_type": 0,
"can_change_quantity": 0
}
]
}
]
},
"custom_attributes": [
{
"attribute_code": "price_view",
"value": "0"
}
]
},
"saveOptions": true
}

Verify this step

  1. On the Luma storefront page, search for Desktop Computer. There should be one result.

    Search

  2. Click on the Desktop Computer product.

    Product

  3. Customize Desktop Computer and add it to the shopping cart.

    Shopping Cart