Create the first simple product using cURL
Adjust environment IDs and product details
Create the first simple product by using the API to send the following POST request using cURL.
Before submitting the request, update the example with values for your environment.
- Change
"attribute-set": 10to replace10with the attribute set ID from your environment. - Change
"value": "13"to replace13with the value from your environment.
Create the second simple product using cURL
Create the second simple product by using the API to send the following POST request using cURL.
Before submitting the request, update the example with values for your environment.
- Change
"attribute_set_id": 10,and replace10with the attribute set id from in your environment. - Change
"value": "14"and replace14with the value from your environment.
Create the third simple product using cURL
Create the third simple product by sending the following POST request using cURL.
Before submitting the request, update the example with values for your environment.
- Change
"attribute_set_id": 10,to replace10with the attribute set ID from your environment. - Change
"value": "15"and replace15with the value from your environment.
Create an empty configurable product using cURL
Create an empty configurable product by sending the following POST request using cURL.
Before submitting the request, update the example with values for your environment.
- Change
"attribute_set_id": 10,and replace10with the attribute set id from your environment. - Change
"value": "93"and replace93with the value from your environment.
Set the options available for the configurable product
Set the options available for the configurable product by sending the following POST request using cURL.
Before submitting the request, change "attribute_id": 93, to replace 93 with the attribute id from your environment.
If you forget to set the options for the configurable product (parent), you get an error when you try to associate a child product to the configurable product. The error message is similar to the following example:
{"message":"The parent product doesn't have configurable product options.","trace":"#0 [internal function]: Magento\\ConfigurableProduct\\Model\\LinkManagement->addChild('Kids-Hawaiian-U...'}
Link the child product to the configurable
Now, you have created three simple products:
"Kids Hawaiian Ukulele Red","Kids-Hawaiian-Ukulele-Blue""Kids-Hawaiian-Ukulele-Green"
Add these simple products as children of the configurable product by sending the following POST request. Submit a separate request for each product.
For each request, update the childSKU value with the value for the child product you are adding. The following example assigns the simple product kids-Hawaiian-Ukulele-red to the configurable product with the SKU Kids-Hawaiian-Ukulele-red.
Get a configurable product using cURL
Now that you have created a configurable product with three assigned child SKUs. You can see the linked IDs for the assigned products by sending the following GET request using cURL. This request returns detailed information about the configurable product.
The following uses the GET method
Get the children product associated to a configurable product
Return only the children associated with the configurable product by sending the following GET request. The response will include all the attributes for the child product including SKU and price.
The following uses the GET method
Delete or remove a child product from the parent configurable
You can remove a child product from a configurable product without deleting the product from the catalog by sending the following DELETE request using cURL.
Additional resources
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Commerce Roadmap Webinar - Americas & EMEA
Preview the Adobe Commerce roadmap for agentic commerce and ask the team questions.
Adobe Commerce Roadmap Webinar - Americas & APAC
Preview the Adobe Commerce roadmap for agentic commerce and ask the team questions.