Good Morning!
I'm currently building my first Magento project, but I'm a veteran PHP developer for years. Now I face a pesky problem.
My request is an import of an XML via an API to solve and that works quite well with PHP and the REST API ... At least the creation of the products and categories ...
But if I contact the "..... / options "and then post to the" ... / childs "I ALWAYS get this error:
{"message": "option values not specified"}
Anyone experience with it? I'm looking forward to your answers!
Solved! Go to Solution.
okay - so you mean you would like to create a configurable product options using rest api ? configuration options like color , size etc ? -
Because for configurable product - AKAIK - using API first you need to create the simple products with specific attributes like color and size etc and after creation of that simple product you need to create a configurable product using REST api - and assigned those simple product to this configurable product !
so you can manage inventory and size accordingly
refer this link for the same it might helps you what you are trying to achieve - http://brijeshtech.in/create-configurable-product-by-rest-api-in-magento2/
Let me know if you still have any issue on this , or if i missed out something
Does it mean you are trying to create a product custom options using Magento 's Rest API ?
@Manthan Dave wrote:
Does it mean you are trying to create a product custom options using Magento 's Rest API ?
Yes! I've added the configurable product and the 10 simple products with the custom attribute... I worked close to this tutorial:
To add custom option into the product ,refer this link - http://brijeshtech.in/magento-2-create-product-custom-options-by-rest-api/
This might help you to add custom options into the product
@Manthan Dave wrote:
To add custom option into the product ,refer this link - http://brijeshtech.in/magento-2-create-product-custom-options-by-rest-api/
This might help you to add custom options into the product
Nice workarround, but not the one thing i need...
I need attributes because of filtering and stock-management. :/ I need it for sizes..
okay - so you mean you would like to create a configurable product options using rest api ? configuration options like color , size etc ? -
Because for configurable product - AKAIK - using API first you need to create the simple products with specific attributes like color and size etc and after creation of that simple product you need to create a configurable product using REST api - and assigned those simple product to this configurable product !
so you can manage inventory and size accordingly
refer this link for the same it might helps you what you are trying to achieve - http://brijeshtech.in/create-configurable-product-by-rest-api-in-magento2/
Let me know if you still have any issue on this , or if i missed out something
Hello @vittorio_emmermann,
Please check below an example of a configurable product example
{ "product":{ "sku":"KudosConfig", "name":"Kudos Configurable", "price":30, "status":1, "type_id":"configurable", "attribute_set_id":4, "extension_attributes":{ "stock_item":{ "is_in_stock":true }, "configurable_product_options":[ { "attribute__id":"193", "label":"Colour", "position":0, "values":[ { "value_index":340 }, { "value_index":341 } ], "product_id":299 }, { "attribute__id":"192", "label":"Size", "position":1, "values":[ { "value_index":343 }, { "value_index":342 } ], "product_id":299 } ], "configurable_product_links":[ 300, 301, 302, 303 ] } } }
Also, here is an example of simple product with custom options
{ "option": { "productSku": "24-WB04", "optionId": 0, "title": "Material", "type": "drop_down", "sortOrder": 0, "isRequire": false, "price": 0, "priceType": "fixed", "sku": "", "values": [ { "title": "Leather", "sortOrder": 0, "price": 0, "priceType": "fixed", "sku": "" }, { "title": "Rexinene", "sortOrder": 0, "price": 0, "priceType": "fixed", "sku": "" }, { "title": "Bata", "sortOrder": 0, "price": 0, "priceType": "fixed", "sku": "" } ], "extensionAttributes": {} } }
--
If my answer is useful, please Accept as Solution & give Kudos
Nice community!
Its tricky to understand magento to 100% but i'll study the source!
Thanks for the replies, everything worked!
Glad to know that its works for you , Happy to help and keep helping