Skip to content

WebAPI REST POST /V1/products gives a generic error in response, without any details. #5338

@karanbhomiagit

Description

@karanbhomiagit

Steps to reproduce

  1. Install Magento from develop branch.
  2. Try creating a simple product by making a call to REST API POST /V1/products.
  3. [Example]
    { "product": { "sku": "atoi-item", "name": "atoi-item", "status": "1", "type_id": "simple", "visibility": "4", "attribute_set_id": "4", "price": "3", "custom_attributes": [ { "attribute_code": "description", "value": "descreeeeeeption" }, { "attribute_code": "category_ids", "value": [ "1", "2" ] } ] } }

I get a response : Status code 400.
Body : {
"message": "Unable to save product"
}

Expected result

  1. Error message in the response body should be more specific.
    There are so many field values that are required to be set on the request JSON, there is no way for the person making the request to identify where the request went wrong.

Actual result

  1. [Example] Error message appears: "Unable to save product".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions