cancel
Showing results for 
Search instead for 
Did you mean: 

REST API Documentation

REST API Documentation

Hi,

I was trying to create product using REST API POST /V1/products.

The schema in swagger JSON says only 'sku' field is mandatory. However, it was observed that 'name' and 'attribute_set' fields are also mandatory.

Can someone point to any documentation regarding each API or confir that swagger JSON is the only concise documentaion available?

Tags (3)
1 REPLY

Re: REST API Documentation

Step1. Generate admin token: I am using token for authorization, so create an admin token using this URL Http://{baseurl}/rest/V1/integration/admin/token

Step2. Add product : For adding the product, I am using following URLhttp://magentogit.com/rest/V1/products/{SKU} , this is magento2 default API using put method. For example:

  

http://baseurl/rest/V1/products/B201-SKU

 header:
   Content-Type - application/json
    Authorization - Bearer token

 Body:
{
  "product": {
    "sku": "B201-SKU",
    "name": "B202",
    "price": 30.00,
    "status": 1,
    "type_id": "simple",
    "attribute_set_id":4,
    "weight": 1
  }
}

 link: http://magento.stackexchange.com/questions/120570/how-to-add-product-in-magento-to-using-rest-api/12...

documentation: http://devdocs.magento.com/swagger/