Not Getting Customer data properly

Solved

Not Getting Customer data properly

DeepakGoswami
Visitor
2 1 0

Not getting the customer details like first name, last name and email after hitting the API.

end point - admin/api/2024-04/customers.json

Accepted Solution (1)
DeepakGoswami
Visitor
2 1 0

This is an accepted solution.

Hello Hardik,

 

Here is the response that we are getting after the API hit-


{"customers":[{"id":6859268259894,"created_at":"2024-06-07T17:39:58+05:30","updated_at":"2024-06-07T17:39:58+05:30","orders_count":0,"state":"disabled","total_spent":"0.00","last_order_id":null,"note":"","verified_email":true,"multipass_identifier":null,"tax_exempt":false,"tags":"","last_order_name":null,"currency":"INR","addresses":[{"id":8025632047158,"customer_id":6859268259894,"company":"566655","province":"Karnataka","country":"India","province_code":"KA","country_code":"IN","country_name":"India","default":true}],"tax_exemptions":[],"email_marketing_consent":{"state":"not_subscribed","opt_in_level":"single_opt_in","consent_updated_at":null},"sms_marketing_consent":{"state":"not_subscribed","opt_in_level":"single_opt_in","consent_updated_at":null,"consent_collected_from":"SHOPIFY"},"admin_graphql_api_id":"gid://shopify/Customer/6859268259894","default_address":{"id":8025632047158,"customer_id":6859268259894,"company":"566655","province":"Karnataka","country":"India","province_code":"KA","country_code":"IN","country_name":"India","default":true}},{"id":6851297280054,"created_at":"2024-06-03T18:04:31+05:30","updated_at":"2024-06-04T13:56:41+05:30","orders_count":0,"state":"disabled","total_spent":"0.00","last_order_id":null,"note":"Notes testing","verified_email":true,"multipass_identifier":null,"tax_exempt":false,"tags":"tags","last_order_name":null,"currency":"INR","addresses":[{"id":8018286772278,"customer_id":6851297280054,"company":"360DegreeCloud","province":"Andaman and Nicobar Islands","country":"India","province_code":"AN","country_code":"IN","country_name":"India","default":false},{"id":8017114398774,"customer_id":6851297280054,"company":"360 Degree cloud","province":"Uttar Pradesh","country":"India","province_code":"UP","country_code":"IN","country_name":"India","default":true}],"tax_exemptions":[],"email_marketing_consent":{"state":"subscribed","opt_in_level":"single_opt_in","consent_updated_at":"2024-06-03T18:04:32+05:30"},"sms_marketing_consent":{"state":"subscribed","opt_in_level":"single_opt_in","consent_updated_at":"2024-06-03T18:04:32+05:30","consent_collected_from":"SHOPIFY"},"admin_graphql_api_id":"gid://shopify/Customer/6851297280054","default_address":{"id":8017114398774,"customer_id":6851297280054,"company":"360 Degree cloud","province":"Uttar Pradesh","country":"India","province_code":"UP","country_code":"IN","country_name":"India","default":true}}]}


Could you please suggest what is the best solution for getting the details 

View solution in original post

Replies 3 (3)

hardik355
Shopify Partner
240 22 36

Hey @DeepakGoswami 

I hope you're doing well!


Could you please provide me with some logs or API responses? Additionally, I believe you have to request permission from Shopify to access certain customer fields via the API.

If helpful then please Like and Accept Solution.
For App Development and Design changes Hire Me.
Skype: live:hardikradadiya355
Thanks
DeepakGoswami
Visitor
2 1 0

This is an accepted solution.

Hello Hardik,

 

Here is the response that we are getting after the API hit-


{"customers":[{"id":6859268259894,"created_at":"2024-06-07T17:39:58+05:30","updated_at":"2024-06-07T17:39:58+05:30","orders_count":0,"state":"disabled","total_spent":"0.00","last_order_id":null,"note":"","verified_email":true,"multipass_identifier":null,"tax_exempt":false,"tags":"","last_order_name":null,"currency":"INR","addresses":[{"id":8025632047158,"customer_id":6859268259894,"company":"566655","province":"Karnataka","country":"India","province_code":"KA","country_code":"IN","country_name":"India","default":true}],"tax_exemptions":[],"email_marketing_consent":{"state":"not_subscribed","opt_in_level":"single_opt_in","consent_updated_at":null},"sms_marketing_consent":{"state":"not_subscribed","opt_in_level":"single_opt_in","consent_updated_at":null,"consent_collected_from":"SHOPIFY"},"admin_graphql_api_id":"gid://shopify/Customer/6859268259894","default_address":{"id":8025632047158,"customer_id":6859268259894,"company":"566655","province":"Karnataka","country":"India","province_code":"KA","country_code":"IN","country_name":"India","default":true}},{"id":6851297280054,"created_at":"2024-06-03T18:04:31+05:30","updated_at":"2024-06-04T13:56:41+05:30","orders_count":0,"state":"disabled","total_spent":"0.00","last_order_id":null,"note":"Notes testing","verified_email":true,"multipass_identifier":null,"tax_exempt":false,"tags":"tags","last_order_name":null,"currency":"INR","addresses":[{"id":8018286772278,"customer_id":6851297280054,"company":"360DegreeCloud","province":"Andaman and Nicobar Islands","country":"India","province_code":"AN","country_code":"IN","country_name":"India","default":false},{"id":8017114398774,"customer_id":6851297280054,"company":"360 Degree cloud","province":"Uttar Pradesh","country":"India","province_code":"UP","country_code":"IN","country_name":"India","default":true}],"tax_exemptions":[],"email_marketing_consent":{"state":"subscribed","opt_in_level":"single_opt_in","consent_updated_at":"2024-06-03T18:04:32+05:30"},"sms_marketing_consent":{"state":"subscribed","opt_in_level":"single_opt_in","consent_updated_at":"2024-06-03T18:04:32+05:30","consent_collected_from":"SHOPIFY"},"admin_graphql_api_id":"gid://shopify/Customer/6851297280054","default_address":{"id":8017114398774,"customer_id":6851297280054,"company":"360 Degree cloud","province":"Uttar Pradesh","country":"India","province_code":"UP","country_code":"IN","country_name":"India","default":true}}]}


Could you please suggest what is the best solution for getting the details 

hardik355
Shopify Partner
240 22 36

Hello @DeepakGoswami 

I think you have to take permission for the field. Please check this docs which one help you https://shopify.dev/docs/apps/launch/protected-customer-data#request-access-to-protected-customer-da... .

If helpful then please Like and Accept Solution.
For App Development and Design changes Hire Me.
Skype: live:hardikradadiya355
Thanks