- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2019
03:43 AM
10-18-2019
03:43 AM
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:
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!
Labels:
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2019
06:08 AM
10-21-2019
06:08 AM
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".