Magento – REST API create simple product

apimagento2productrest

I am doing an integration with our other systems where I am trying to create a simple product (for now) in Magento 2.0.0 (will update soon but in the middle of this) using a rest call. I have tried both post and put and both work but for some odd reason the price, weight and tax code I send are ignored. All three fields are present in the payload (triple checked). No error just ignored and all three are left empty.

Anyone know if there is something specific about these three fields? I haven't tried updating the product yet so I don't know if that works.

Best Answer

POST /V1/products should be used for product creation, while PUT /V1/products/:sku for product update. They both rely on the same service method \Magento\Catalog\Model\ProductRepository::save, but that may be your problem.

Related Topic