Adobe Commerce | Using Magento Commerce APIs to fetch Customer ID | Community
Skip to main content
pulkitvashisth
Community Advisor
Community Advisor
July 8, 2024

Adobe Commerce | Using Magento Commerce APIs to fetch Customer ID

  • July 8, 2024
  • 1 reply
  • 965 views

Hi all,
I was using Adobe Commerce Integration Framework in my AEM instance along with Commerce OOTB react SPA object. We were using Magento APIs for fetching user data at multiple places in the website. 
While using the graphql queries of magento , when we were fetching ID using the query 

 

query Customer { customer { id email firstname middlename lastname date_of_birth gender }}

In the documentation it give id as deprecated. And thus id parallel to customers comes null.

Is this what is its returning generally now that its deprecated or is there an issue from our side?
Or is there any other approach that we need to follow now to fetch customer ID from magento?

I was able to find one approach in which I would need to use the Magento rest API with query parameters to fetch user info using Admin Credentials.

{magento-domain}/rest/V1/customers/search?searchCriteria[filterGroups][0][filters][0][field]=email&searchCriteria[filterGroups][0][filters][0][value]=demouser1@test.com&searchCriteria[filterGroups][0][filters][0][conditionType]=eq

 

Which I don't think is appropriate.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Community Manager
Community Manager
August 1, 2024

@arunpatidar @aanchal-sikka @h_kataria @mukeshyadav_ , If you could share your thoughts on this? 

Kautuk Sahni