Development discussions around Shopify APIs
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.
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.
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
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!
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...By Jacqui Mar 10, 2023
Upskill and stand out with the new Shopify Foundations Certification programBy SarahF_Shopify Mar 6, 2023
One of the key components to running a successful online business is having clear and co...By Ollie Mar 6, 2023