I am struggling with POST REST API's in Magento 2 as I am quite new to it. If possible, can anyone provide me one example for POST like creation of product or add to cart using oAuth and admin account, please help me.
Thanks in Advance
Look at how to get admin token, and check out available web API endpoints documentation (pay attention to catalogProductRepositoryV1
).
Sample to create bundle product :
{"product":{
"sku": "Bundle2",
"name": "Bundle Product 2",
"attribute_set_id": 4,
"price": 12,
"status": 1,
"visibility": 4,
"weight": 3,
"extension_attributes": {
"bundle_product_options": [
{
"title": "Select",
"required": true,
"type": "select",
"position": 0,
"sku": "Bundle2",
"product_links": [
{
"sku": "eraser",
"is_default": false
}
]
}
]
},
"custom_attributes": [
{
"attribute_code": "multiple_select",
"value": ["4"]
}
]
}
}