2

I got below error on my rest API on magento2.1

{
    "message": "%fieldName is a required field.",
    "parameters": {
        "fieldName": "product"
    }
}

My URL is: https://XXX/rest/all/V1/products

I want to add or edit the product in both POST and PUT method got the same error. my code to create/update is

 "product": {
        "sku": "B201-SKU",
        "name": "B202",
        "price": 30.00,
        "status": 1,
        "type_id": "simple",
        "attribute_set_id":4,
        "weight": 1
    }

Also, use postman and set authentication on it, GET method is ok but PUT and POST gets error

1
  • any body knows?
    – MGPM
    Jul 5, 2019 at 6:17

1 Answer 1

0

Seem to be missing opening / closing brackets. Try this -

{
    "product": {
    "sku": "B201-SKU",
    "name": "B202",
    "price": 30.00,
    "status": 1,
    "type_id": "simple",
    "attribute_set_id":4,
    "weight": 1
    }
}
1
  • No, still get same error...
    – MGPM
    Jul 30, 2019 at 6:56

Your Answer

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

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