Requesting customer data via shopify API

Dkaigorodov
New Member
2 0 0

Hi everyone.

Currently I'm working on shopify app which allows DPOs to handle SAR requests right from shopify and one of the app's features is to send all customer's data (from shopify and also DPO is able to upload additional data). Is it possible to get all customer's data (like CSV files linked to email I received after requested customers data on customer's details page) via restfull \ graphql api? I found most of them but responses data is a bit different than in CSV files. 

 

Thanks.

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 223

The API typically return data in a JSON-formatted response body. There isn't really a baked-in option of downloading a delimited text file. Depending on the development environment you plan to use for the app there are packages likely available that can transform a JSON response into CSV-type output. If you were to choose between the REST API and the GraphQL API for your project, I would recommend the GraphQL API. Since there are likely just a handful of specific customer fields you are looking for. Rather than pulling any/all fields and parsing through them with the REST API, you can specifically request just those fields you want with the GraphQL API. 

Dkaigorodov
New Member
2 0 0

Thanks for your reply.

Yes, I understand I need to convert json response to CSV by myself. The problem is API doesn't return some fields which CSV files contain. For example for payment methods it returns firstDigits and lastDigits but not cardholder name. So question is not about receiving CSV but how to get all the data we have in CSV files via API

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 223

Oh I see what you're getting at now. I don't see those particular exposed in either the REST or GraphQL API's. Unless there is another mechanism available to retrieve them I'm stumped as well. Sorry!

0 Likes