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!
2 REPLIES 2

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".

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

Great point about the missing accessor method — that error can definitely be frustrating when mapping custom attributes in Magento. I’ve seen developers run into similar issues while managing property data, and exploring resources like Lee County Appraiser  can help clarify data structure expectations. Ensuring getter methods are properly defined and consistent with Magento naming rules usually resolves the problem quickly. Thanks for bringing this up — it’s a useful reminder to double-check method naming during setup.