1

I read this page http://devdocs.magento.com/swagger/index.html, but I couldn't find any API for adding new product to website.

1 Answer 1

0

I'm not entirely sure what you are asking specifically, but using the swagger REST API reference, you are looking for the catalogProductRepositoryV1. Format the request to be something like this (assuming you were using c#):

var request = new RestRequest("V1/products", Method.POST);

You will need to send the attributes via a body parameter.

You will want to assign it to at least one category. This will be done as the custom attribute "category_ids".

Be sure to send it in this format:

"custom_attributes": [
  {
    "attribute_code": "string",
    "value": "string"
  }
]

I hope this helps.

1
  • It wasn't there when I asked the question.
    – Vahid
    Commented Dec 1, 2016 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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