Expand my Community achievements bar.

Adobe Commerce | Using Magento Commerce APIs to fetch Customer ID

Avatar

Community Advisor

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.

1 Reply

Avatar

Administrator

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



Kautuk Sahni