0

I am writing a Magento 2 REST API APP so far I can get a token, Update a SKU with PUT but I am not able to POST a new SKU or a new costumer. So far I understand that you update with PUT and create with POST. I followed several examples without luck.

I am testing with Postman.

Here is my HTTP:

POST 

/rest/V1/customers 
HTTP/1.1

Host: 192.168.2.153

Header
Content-Type: application/json
Authorization: Bearer mfgsw0jtevp95ok1la99rysv0aqf9maj
Cache-Control: no-cache

Body:
{
  "customer": {
"email": "user@test.com",
"firstname": "name",
"lastname": "lastname",
"storeid": 1,
"websiteid": 1
  }
}

Answere:

{
    "message": "Internal Error. Details are available in Magento log     file. Report ID: webapi-5ab75d4ddd21c"

}

exception.log

[2018-03-25 07:04:06] main.CRITICAL: Report ID: webapi-5ab749e684459; Message: Property "Storeid" does not have corresponding setter in class "Magento\Customer\Api\Data\CustomerInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5ab749e684459; Message: Property \"Storeid\" does not have corresponding setter in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Property \"Storeid\" does not have corresponding setter in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/Reflection/NameFinder.php:100)"} []
0

I found the problem.

It was the Store ID.

So the code abouve works if you take out the line containing StoreID.

  • magento ver 1.9.2.3,I am work with REST API in POSTMAN, i have all oAuth 1.0 details like Consumer Key,Consumer Secret,Access Token,Token Secret. Now i moved to oAuth 2.0, how can i get my all oAuth 2.0 details? @Michael Müllerju Kasa – zus Oct 30 '18 at 6:32

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.