1

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

1

Look at how to get admin token, and check out available web API endpoints documentation (pay attention to catalogProductRepositoryV1).

1

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"]

     }
     ]
    }
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.