I am getting below error while hit REST API from postman:

"message": "The product can't be saved.",

I have used below details for API:

URL: magento.localhost/rest/V1/products/p1/media



Authorization:Bearer 1si2ch4k8to78ytx14is8gcgfs4p3glk


         "name":"new image"

Can anyone please help me in this? I tried lot of thing but nothing is working.


Make sure the product you are using has all the required fields saved to the product before trying to upload the image via the rest API.

In our case the price of the product was missing, which caused a validation failure in Magento 2.

Note that this will apply to any custom required attribute as well.

|improve this answer|||||
  • I tried to save the product in the magento admin and an error showed up. In my case a custom attribute was missing. Fixed the issue and it worked. – Memonic Sep 17 '19 at 14:36
  • I have added your comment to the solution as well – master Sep 18 '19 at 9:00

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.