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

  • any body knows? – MGPM Jul 5 at 6:17
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
    }
}
  • No, still get same error... – MGPM Jul 30 at 6:56

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.