cancel
Showing results for 
Search instead for 
Did you mean: 

REST API - create new product

REST API - create new product

Cannot create new product with rest/V1/products POST method but can update with the same.

How to create a new product?

4 REPLIES

Re: REST API - create new product

Hi @RB10100,

 

I guess you've cheked the documentation: http://devdocs.magento.com/swagger/#!/catalogProductRepositoryV1/catalogProductRepositoryV1SavePost

 

Are you sure you are using POST instead of PUT ?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: REST API - create new product

Yes I am using POST

Re: REST API - create new product

Hello,

 

you need to use put

 

/V1/products/{sku}

 

$productData = [
    "sku" : "sku-test"
    "name": "Test",
    "price": 100,
    "status": 1
];

Re: REST API - create new product

I am getting {"message":"Invalid product data: %1","parameters":["Invalid attribute set entity type"]} error. Cannot create products.