cancel
Showing results for 
Search instead for 
Did you mean: 

Magento Rest API Property 'xxx' does not have accessor method 'getxxx" in class

Magento Rest API Property 'xxx' does not have accessor method 'getxxx" in class

Hi,

 

I've added few custom customer attributes, and they're working fine with the registration page.

 

But when Im doing it via REST API call. it returns an error:

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

log is as follows:
main.CRITICAL: Report ID: webapi-5da995c55b17b; Message: Property "Residency" does not have accessor method "getResidency" in class "Magento\Customer\Api\Data\CustomerInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5da995c55b17b; Message: Property \"Residency\" does not have accessor method \"getResidency\" in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at C:\\xampp\\htdocs\\buyani\\vendor\\magento\\framework\\Webapi\\ErrorProcessor.php:208, LogicException(code: 0): Property \"Residency\" does not have accessor method \"getResidency\" in class \"Magento\\Customer\\Api\\Data\\CustomerInterface\". at C:\\xampp\\htdocs\\buyani\\vendor\\magento\\framework\\Reflection\\NameFinder.php:100)"} []
 
 
Thanks!
1 REPLY 1

Re: Magento Rest API Property 'xxx' does not have accessor method 'getxxx" in class

When you add any custom attribute to Product, category or Customer that does not included in API interface files. So if you want that attribute in your API response then you have to fetch that attribute as extension attribute or you have to override full api.

You have to add your custom attribute getter setter methods in api interface files and then you can fetch that attribute.

If answer helps then please click "Kudos" and "accept solution".